66% js-vehicle-manager

Code Review | WP Vehicle Manager

WordPress plugin WP Vehicle Manager scored66%from 54 tests.

About plugin

  • Plugin page: js-vehicle-manager
  • Plugin version: 1.1.8
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8.2
  • WordPress version: 6.3.1
  • First release: Dec 4, 2017
  • Latest release: Feb 17, 2022
  • Number of updates: 38
  • Update frequency: every 40.6 days
  • Top authors: rabilal (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /9,622 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲2.12MB] [CPU: ▲9.67ms] Passed 4 tests

A check of server-side resources used by WP Vehicle Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.82 ▲2.3656.38 ▲15.51
Dashboard /wp-admin5.57 ▲2.2267.12 ▲6.32
Posts /wp-admin/edit.php5.48 ▲2.1259.50 ▲8.92
Add New Post /wp-admin/post-new.php7.97 ▲2.09100.82 ▲7.92
Media Library /wp-admin/upload.php5.28 ▲2.0560.45 ▲23.23
Conditions /wp-admin/admin.php?page=jsvm_conditions5.6254.91
Vehicles /wp-admin/admin.php?page=jsvm_vehicle5.7343.68
Premium Addon /wp-admin/admin.php?page=purchasehistory5.5244.39
Users /wp-admin/admin.php?page=jsvm_user6.0156.45
Premium Addon /wp-admin/admin.php?page=export5.5245.20
Premium Addon /wp-admin/admin.php?page=creditspack5.5245.98
Email options /wp-admin/admin.php?page=jsvm_emailtemplatestatus5.6153.92
Premium Addon /wp-admin/admin.php?page=buyercontacttoseller5.5243.18
Fuel Types /wp-admin/admin.php?page=jsvm_fueltypes5.6352.65
Premium Addon /wp-admin/admin.php?page=themes5.5245.46

Server storage [IO: ▲8.76MB] [DB: ▲0.14MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 915 new files
Database: 25 new tables, 11 new options
New tables
wp_js_vehiclemanager_vehicleimages
wp_js_vehiclemanager_transmissions
wp_js_vehiclemanager_fieldsordering
wp_js_vehiclemanager_users
wp_js_vehiclemanager_countries
wp_js_vehiclemanager_cylinders
wp_js_vehiclemanager_emailtemplates_config
wp_js_vehiclemanager_config
wp_js_vehiclemanager_states
wp_js_vehiclemanager_cities
...
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_widget_js_vehicle_manager_vehicles_by_cities_widget_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
jsvehiclemanager_do_activation_redirect
widget_widget_js_vehicle_manager_pages_widget_options
can_compress_scripts
_wpjsvm_session_
...

Browser metrics Passed 4 tests

WP Vehicle Manager: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,207 ▲46114.30 ▼0.107.12 ▲5.4739.92 ▼2.47
Dashboard /wp-admin2,503 ▲3185.63 ▲0.53120.55 ▲8.5099.91 ▲53.73
Posts /wp-admin/edit.php2,175 ▲862.43 ▲0.3840.84 ▲3.2333.01 ▼3.51
Add New Post /wp-admin/post-new.php18,080 ▲16,56625.91 ▲8.271,240.87 ▲554.8338.38 ▼20.38
Media Library /wp-admin/upload.php1,460 ▲754.56 ▲0.42109.18 ▲11.4781.87 ▲35.88
Conditions /wp-admin/admin.php?page=jsvm_conditions1,6462.7649.0089.27
Vehicles /wp-admin/admin.php?page=jsvm_vehicle2,0582.76112.4548.50
Premium Addon /wp-admin/admin.php?page=purchasehistory1,3812.2335.5874.02
Users /wp-admin/admin.php?page=jsvm_user1,6492.6950.4254.34
Premium Addon /wp-admin/admin.php?page=export1,3872.2233.9661.77
Premium Addon /wp-admin/admin.php?page=creditspack1,3812.2235.9360.84
Email options /wp-admin/admin.php?page=jsvm_emailtemplatestatus1,6192.7648.9985.36
Premium Addon /wp-admin/admin.php?page=buyercontacttoseller1,3812.2333.9676.12
Fuel Types /wp-admin/admin.php?page=jsvm_fueltypes1,7512.6449.3486.41
Premium Addon /wp-admin/admin.php?page=themes1,3842.2134.7149.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 11 options
    • _wpjsvm_session_
    • widget_widget_js_vehicle_manager_pages_widget_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_widget_js_vehicle_manager_vehicles_widget_options
    • widget_widget_js_vehicle_manager_vehicles_by_cities_widget_options
    • theysaidso_admin_options
    • widget_recent-comments
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=jsvm_vehicle
    • > Notice in wp-content/plugins/js-vehicle-manager/js-vehicle-manager.php+425
    Trying to access array offset on value of type bool
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=themes
    • > Notice in wp-content/plugins/js-vehicle-manager/modules/premiumplugin/tmpl/admin_missingaddon.php+13
    Undefined offset: 1

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
Please take a closer look at the following
  • 190× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/js-vehicle-manager/modules/cylinders/tmpl/admin_cylinders.php
    • > /wp-content/plugins/js-vehicle-manager/includes/activation.php
    • > /wp-content/plugins/js-vehicle-manager/includes/tables/zip.php
    • > /wp-content/plugins/js-vehicle-manager/modules/configuration/tmpl/admin_configurations.php
    • > /wp-content/plugins/js-vehicle-manager/includes/css/site_color.php
    • > /wp-content/plugins/js-vehicle-manager/modules/fieldordering/model.php
    • > /wp-content/plugins/js-vehicle-manager/modules/user/tmpl/stats.php
    • > /wp-content/plugins/js-vehicle-manager/includes/lib/oauth_client.php
    • > /wp-content/plugins/js-vehicle-manager/modules/make/tmpl/admin_makes.php
    • > /wp-content/plugins/js-vehicle-manager/modules/fieldordering/tmpl/admin_searchfieldsordering.php
  • 37× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'jsvehiclemanager' not found in wp-content/plugins/js-vehicle-manager/modules/user/tmpl/viewsellerinfo.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/js-vehicle-manager/includes/widgets/jsvehicle_manager_vehicles_widget.php:6
    • > PHP Warning
      Use of undefined constant CAR_MANAGER_IMAGE - assumed 'CAR_MANAGER_IMAGE' (this will throw an Error in a future version of PHP) in wp-content/plugins/js-vehicle-manager/modules/vehicle/tmpl/vehicledetail.inc.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/js-vehicle-manager/modules/vehicle/tmpl/refinesearchpopup.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/js-vehicle-manager/includes/addon-updater/views/html-key-input.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugins() in wp-content/plugins/js-vehicle-manager/modules/premiumplugin/tmpl/admin_step2.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'JSVEHICLEMANAGERincluder' not found in wp-content/plugins/js-vehicle-manager/modules/premiumplugin/tmpl/admin_missingaddon.php:3
    • > PHP Warning
      Use of undefined constant CAR_MANAGER_IMAGE - assumed 'CAR_MANAGER_IMAGE' (this will throw an Error in a future version of PHP) in wp-content/plugins/js-vehicle-manager/modules/vehicle/tmpl/vehicledetail.inc.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/js-vehicle-manager/modules/postinstallation/tmpl/admin_demoimporter.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/js-vehicle-manager/modules/user/tmpl/profile.inc.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=themes
    • > Javascript (severe) in unknown
    https://www.google.com/jsapi?autoload=%7B%27modules%27%3A%5B%7B%27name%27%3A%27visualization%27%2C%27version%27%3A%271%27%2C%27packages%27%3A%5B%27corechart%27%5D%7D%5D%7D&ver=6.3.1 150:139 Uncaught Error: Autoload failed with: SyntaxError: Expected proper…me or '}' in JSON at position 1 (line 1 column 2)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jsvm_user
    • > Network (severe)
    wp-content/plugins/js-vehicle-manager/includes/images/normal-button - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=purchasehistory
    • > 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: jQuery(...).accordion is not a function" "TypeError: jQuery(...).accordion is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=purchasehistory:154:26)\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
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=themes
    • > 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: jQuery(...).accordion is not a function
    • > GET request to /wp-admin/admin.php?page=export
    • > 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: jQuery(...).accordion is not a function" "TypeError: jQuery(...).accordion is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=export:154:26)\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=creditspack
    • > 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: jQuery(...).accordion is not a function" "TypeError: jQuery(...).accordion is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=creditspack:154:26)\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=buyercontacttoseller
    • > 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: jQuery(...).accordion is not a function" "TypeError: jQuery(...).accordion is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=buyercontacttoseller:154:26)\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=themes
    • > 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: jQuery(...).accordion is not a function" "TypeError: jQuery(...).accordion is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=themes:154:26)\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 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: There are too many tags (34 tag instead of maximum 10)
The official readme.txt is a good inspiration

js-vehicle-manager/js-vehicle-manager.php Passed 13 tests

The main PHP file in "WP Vehicle Manager" ver. 1.1.8 adds more information about the plugin and also serves as the entry point for this plugin
80 characters long description:
WP Vehicle Manager is Word Press most comprehensive and easist show room plugin.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin79,432 lines of code in 283 files:
LanguageFilesBlank linesComment linesLines of code
PHP2245,04211,11355,570
CSS221,61626113,362
PO File22,6473,1545,446
JavaScript185155844,607
JSON100398
SQL154048
HTML1001

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 574)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity63.30
▷ Minimum class complexity1.00
▷ Maximum class complexity823.00
Average method complexity8.01
▷ Minimum method complexity1.00
▷ Maximum method complexity574.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes117
▷ Abstract classes00.00%
▷ Concrete classes117100.00%
▷ Final classes00.00%
Methods1,039
▷ Static methods706.74%
▷ Public methods1,02298.36%
▷ Protected methods10.10%
▷ Private methods161.54%
Functions103
▷ Named functions103100.00%
▷ Anonymous functions00.00%
Constants124
▷ Global constants124100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
553 compressed PNG files occupy 2.20MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/default-makes/eagle.png6.64KB6.64KB0.01%
includes/css/images/ui-bg_flat_0_eeeeee_40x100.png0.18KB0.08KB▼ 51.67%
includes/images/vc-icons/list_vehicles.png0.24KB0.24KB0.00%
includes/images/left-icons/faqs.png0.70KB0.67KB▼ 5.27%
includes/images/fe-forced-delete.png0.35KB0.33KB▼ 5.93%