10% hq-rental-software

Code Review | HQ Rental Software

WordPress plugin HQ Rental Software scored10%from 54 tests.

About plugin

  • Plugin page: hq-rental-software
  • Plugin version: 1.5.29
  • PHP compatiblity: 7.3.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.0-6.0
  • WordPress version: 6.3.1
  • First release: May 6, 2019
  • Latest release: Mar 30, 2023
  • Number of updates: 175
  • Update frequency: every 8.1 days
  • Top authors: caagsoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /8,595 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

Server metrics [RAM: ▲6.04MB] [CPU: ▲17.17ms] 75% from 4 tests

An overview of server-side resources used by HQ Rental Software
Please fix the following
  • Extra RAM: Extra memory usage should kept under 5MB (currently 6.04MB on /wp-admin/admin.php?page=hq-vehicle-classes)
PageMemory (MB)CPU Time (ms)
Home /9.59 ▲6.1277.57 ▲31.81
Dashboard /wp-admin9.37 ▲6.0774.21 ▲24.61
Posts /wp-admin/edit.php9.26 ▲5.9057.81 ▲5.44
Add New Post /wp-admin/post-new.php12.02 ▲6.13107.23 ▲6.83
Media Library /wp-admin/upload.php9.30 ▲6.0771.08 ▲34.00
Brands /wp-admin/admin.php?page=hq-brands9.30499.29
Locations /wp-admin/admin.php?page=hq-locations9.30499.95
HQ Rentals /wp-admin/admin.php?page=hq-wordpress-settings9.30495.60
Vehicle Classes /wp-admin/admin.php?page=hq-vehicle-classes9.30496.46

Server storage [IO: ▲14.39MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 353 new files
Database: 5 new tables, 36 new options
New tables
wp_hq_car_rental_preferences
wp_hq_brands
wp_hq_vehicle_active_rates
wp_hq_locations
wp_hq_vehicle_classes
New WordPress options
hq_replace_url_on_brand_option
hq_wordpress_front_end_datetime_format_option
hq_enable_custom_post_pages
can_compress_scripts
hq_wordpress_home_integration_enabled
widget_recent-comments
hq_google_country
hq_location_address_label_field
hq_override_daily_rate_with_price_interval
hq_wordpress_api_base_url_option
...

Browser metrics Passed 4 tests

HQ Rental Software: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲14913.50 ▼0.699.04 ▲6.8745.52 ▲2.66
Dashboard /wp-admin2,217 ▲365.56 ▼0.1787.76 ▼21.1870.46 ▲27.55
Posts /wp-admin/edit.php2,116 ▲161.99 ▼0.0338.06 ▼1.8735.90 ▼2.87
Add New Post /wp-admin/post-new.php1,568 ▲4023.19 ▼0.19723.94 ▲46.7975.12 ▲18.16
Media Library /wp-admin/upload.php1,431 ▲344.26 ▲0.0399.00 ▼3.2381.60 ▲40.32
Brands /wp-admin/admin.php?page=hq-brands1,3073.6044.8846.18
Locations /wp-admin/admin.php?page=hq-locations1,2953.5944.5033.75
HQ Rentals /wp-admin/admin.php?page=hq-wordpress-settings2,2564.6951.4077.80
Vehicle Classes /wp-admin/admin.php?page=hq-vehicle-classes1,2993.5841.1035.27

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie tables were found after uninstall: 5 tables
    • wp_hq_brands
    • wp_hq_locations
    • wp_hq_vehicle_classes
    • wp_hq_vehicle_active_rates
    • wp_hq_car_rental_preferences
  • The uninstall procedure has failed, leaving 36 options in the database
    • hq_location_description_field
    • hq_wordpress_disable_cronjob_option
    • hq_default_longitude_for_map_shortcode
    • hq_url_to_replace_on_brands_option
    • hq_replace_url_on_brand_option
    • hq_wordpress_home_integration_enabled
    • widget_recent-posts
    • hq_wordpress_tenant_datetime_format
    • hq_enable_decreasing_rate_order_on_vehicles_query
    • theysaidso_admin_options
    • ...

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

SRP 0% 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
  • 9× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/hq-rental-software/includes/unyson/carrental-child/shortcodes/hq-form-test.php
    • > /wp-content/plugins/hq-rental-software/includes/unyson/extensions/shortcodes/shortcodes/vehicle-tab/views/view.php
    • > /wp-content/plugins/hq-rental-software/includes/unyson/extensions/shortcodes/shortcodes/vehicle-tab/options.php
    • > /wp-content/plugins/hq-rental-software/includes/unyson/carrental-child/shortcodes/hq-reservation-link-lang-helper.php
    • > /wp-content/plugins/hq-rental-software/includes/unyson/extensions/shortcodes/hooks.php
    • > /wp-content/plugins/hq-rental-software/includes/unyson/carrental-child/shortcodes/hq-vehicles.php
    • > /wp-content/plugins/hq-rental-software/includes/unyson/extensions/shortcodes/shortcodes/vehicle-tab/config.php
    • > /wp-content/plugins/hq-rental-software/includes/unyson/carrental-child/shortcodes/hq-location-map.php
    • > /wp-content/plugins/hq-rental-software/includes/unyson/carrental-child/shortcodes/hq-form.php
  • 107× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/hq-rental-software/includes/unyson/carrental-child/one-page.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'HQRentalsPlugin\\HQRentalsModels\\HQRentalsBaseModel' not found in wp-content/plugins/hq-rental-software/includes/models/HQRentalsModelsCarRentalSetting.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'HQRentalsPlugin\\HQRentalsTasks\\HQRentalsBaseTask' not found in wp-content/plugins/hq-rental-software/includes/tasks/HQRentalsAdditionalChargesTask.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'HQRentalsPlugin\\HQRentalsSettings\\HQRentalsSettings' not found in wp-content/plugins/hq-rental-software/includes/templates/page-quotes.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function vc_map() in wp-content/plugins/hq-rental-software/includes/bakery/motors/hq-vehicles-grid-filter-brand.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WPBakeryShortCode' not found in wp-content/plugins/hq-rental-software/includes/bakery/wheelsberry/HQRentalBakeryWheelsberryLocationsMap.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/hq-rental-software/includes/elementor/aucapina/hq-pegaso/shortcodes/hq-vehicle-grid.php:183
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hq-rental-software/includes/unyson/carrental-child/functions.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'HQRentalsPlugin\\HQRentalsModels\\HQRentalsBaseModel' not found in wp-content/plugins/hq-rental-software/includes/models/HQRentalsModelsAdditionalCharge.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'HQRentalBakeryMotorsVehicleGridShortcode' not found in wp-content/plugins/hq-rental-software/includes/bakery/motors/HQRentalBakeryMotorsVehicleGridShortcode.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
1 plugin tags: hqrentalsoftware

hq-rental-software/hq-wordpress.php 77% from 13 tests

The primary PHP file in "HQ Rental Software" version 1.5.29 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hq-rental-software.php" instead of "hq-wordpress.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected52,071 lines of code in 298 files:
LanguageFilesBlank linesComment linesLines of code
PHP1992,3492,62326,113
CSS343,26547018,602
SVG4613,353
JavaScript552251502,826
PO File45038051,084
Markdown275093

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity6.95
▷ Minimum class complexity1.00
▷ Maximum class complexity131.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces23
Interfaces1
Traits0
Classes159
▷ Abstract classes53.14%
▷ Concrete classes15496.86%
▷ Final classes10.65%
Methods1,320
▷ Static methods977.35%
▷ Public methods1,22292.58%
▷ Protected methods473.56%
▷ Private methods513.86%
Functions69
▷ Named functions1724.64%
▷ Anonymous functions5275.36%
Constants22
▷ Global constants29.09%
▷ Class constants2090.91%
▷ Public constants20100.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
10 PNG files occupy 0.65MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/img/logo-admin.png8.13KB0.55KB▼ 93.24%
assets/screenshot-2.png36.26KB17.34KB▼ 52.19%
images/pin.png4.13KB2.64KB▼ 36.11%
assets/screenshot-1.png38.87KB18.27KB▼ 53.00%
includes/assets/img/logo.png9.08KB3.83KB▼ 57.85%