83% motors-vin-decoder

Code Review | Motors VIN Decoder

WordPress plugin Motors VIN Decoder scored83%from 54 tests.

About plugin

  • Plugin page: motors-vin-decoder
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Aug 18, 2020
  • Latest release: Apr 4, 2023
  • Number of updates: 19
  • Update frequency: every 50.5 days
  • Top authors: stylemix (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active /6,401 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.30MB] [CPU: ▼3.47ms] Passed 4 tests

This is a short check of server-side resources used by Motors VIN Decoder
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2042.60 ▲0.84
Dashboard /wp-admin3.68 ▲0.3453.20 ▼12.61
Posts /wp-admin/edit.php3.73 ▲0.3855.37 ▲1.40
Add New Post /wp-admin/post-new.php6.22 ▲0.3495.89 ▼3.52
Media Library /wp-admin/upload.php3.54 ▲0.3239.65 ▲6.51
Upgrade /wp-admin/admin.php?page=stm_vin_decoders_go_pro3.56217.22
Nhtsa Check Settings /wp-admin/options.php?page=stm_vin_decoders_settings-nhtsa3.5635.05
Motors Vin Decoder /wp-admin/admin.php?page=stm_vin_decoders_settings3.5834.03

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 84 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
stm_vin_method_name
widget_stm_full_report_wp_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_stm_specification_widget

Browser metrics Passed 4 tests

A check of browser resources used by Motors VIN Decoder
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,945 ▲18414.19 ▼0.349.63 ▲8.0243.31 ▲0.84
Dashboard /wp-admin2,239 ▲656.01 ▲0.48112.55 ▲13.2083.52 ▲39.50
Posts /wp-admin/edit.php2,147 ▲652.65 ▲0.6241.11 ▲4.2337.08 ▲0.98
Add New Post /wp-admin/post-new.php1,718 ▲17826.85 ▲4.21697.98 ▲53.1337.39 ▼22.63
Media Library /wp-admin/upload.php1,444 ▲504.67 ▲0.49122.43 ▲24.9050.31 ▲6.24
Upgrade /wp-admin/admin.php?page=stm_vin_decoders_go_pro1,0332.3328.4443.39
Nhtsa Check Settings /wp-admin/options.php?page=stm_vin_decoders_settings-nhtsa9212.3132.3346.96
Motors Vin Decoder /wp-admin/admin.php?page=stm_vin_decoders_settings1,2762.3329.7039.89

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 9 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • stm_vin_method_name
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_stm_specification_widget
    • widget_stm_full_report_wp_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 30× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_theme() in wp-content/plugins/motors-vin-decoder/templates/providers/stm_nhtsa_auto_complete_settings_page.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_get() in wp-content/plugins/motors-vin-decoder/templates/stm_auto_complete_go_pro.php:7
    • > PHP Warning
      get_called_class() called from outside a class in wp-content/plugins/motors-vin-decoder/templates/stm_auto_complete_settings_history_page.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/motors-vin-decoder/templates/motors_vin_check_header_button.php:2
    • > PHP Warning
      get_called_class() called from outside a class in wp-content/plugins/motors-vin-decoder/templates/stm_auto_complete_settings_page.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/motors-vin-decoder/includes/item-announcements.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/motors-vin-decoder/templates/motors_vin_modal_template.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/motors-vin-decoder/includes/vin-decoder-conf.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/motors-vin-decoder/includes/classes/STM_Full_Report_WP_Widget.php:2
    • > PHP Warning
      include_once(): Failed opening 'STM_MOTORS_VIN_DECODERS_PATH/templates/stm_auto_history_shortcode_view.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/motors-vin-decoder/vc/templates/stm_auto_specification_template.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add descriptions for screenshots #4, #5, #6 in motors-vin-decoder/assets to your readme.txt
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

motors-vin-decoder/motors-vin-decoder.php 92% from 13 tests

The entry point to "Motors VIN Decoder" version 1.0.9 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 223 characters long)

Code Analysis Passed 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
No dangerous file extensions were detected2,682 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP365031632,421
SVG1200255
CSS6006

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes12
▷ Abstract classes216.67%
▷ Concrete classes1083.33%
▷ Final classes00.00%
Methods74
▷ Static methods1722.97%
▷ Public methods6891.89%
▷ Protected methods34.05%
▷ Private methods34.05%
Functions17
▷ Named functions1270.59%
▷ Anonymous functions529.41%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.16MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo-footer.png2.73KB1.60KB▼ 41.44%
assets/img/wpbakery_vin.png54.00KB14.60KB▼ 72.96%
assets/img/vinaudit-usa-v3.3_85.png3.64KB2.63KB▼ 27.93%
assets/img/vin_decoder.png13.93KB6.11KB▼ 56.12%
assets/img/elementor_vin.png80.46KB21.39KB▼ 73.42%