78% dvla-search

Code Review | DVLA Search

WordPress plugin DVLA Search scored78%from 54 tests.

About plugin

  • Plugin page: dvla-search
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3.0
  • WordPress version: 6.3.1
  • First release: May 22, 2017
  • Latest release: Nov 20, 2019
  • Number of updates: 12
  • Update frequency: every 76.3 days
  • Top authors: dvlasearch (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,100 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼0.23ms] Passed 4 tests

An overview of server-side resources used by DVLA Search
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.61 ▲0.08
Dashboard /wp-admin3.36 ▲0.0648.81 ▼2.22
Posts /wp-admin/edit.php3.42 ▲0.0653.01 ▲3.55
Add New Post /wp-admin/post-new.php5.94 ▲0.0699.08 ▼0.74
Media Library /wp-admin/upload.php3.29 ▲0.0640.72 ▲1.96
Setup and API Key /wp-admin/admin.php?page=dvla_search3.2535.30
Custom Results Page and Shortcode Help /wp-admin/admin.php?page=dvla_search_custom_results_help3.2533.18
Results Fields /wp-admin/admin.php?page=dvla_search_results_fields3.2638.00

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_dvla_search_widget

Browser metrics Passed 4 tests

A check of browser resources used by DVLA Search
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲3614.27 ▼0.071.79 ▼0.0447.74 ▲0.11
Dashboard /wp-admin2,229 ▲525.51 ▼0.1489.37 ▼0.9342.16 ▲0.55
Posts /wp-admin/edit.php2,131 ▲312.02 ▼0.0038.95 ▼2.2636.01 ▼6.11
Add New Post /wp-admin/post-new.php1,551 ▲2223.49 ▲0.51661.03 ▲35.1654.64 ▲4.28
Media Library /wp-admin/upload.php1,428 ▲254.21 ▲0.04101.45 ▼0.2043.19 ▼2.94
Setup and API Key /wp-admin/admin.php?page=dvla_search8502.1223.5328.42
Custom Results Page and Shortcode Help /wp-admin/admin.php?page=dvla_search_custom_results_help1,1501.9924.6445.55
Results Fields /wp-admin/admin.php?page=dvla_search_results_fields9542.0022.4528.65

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_dvla_search_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/dvla-search/includes/render_plate.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dvla-search/includes/dvla_search_result_number_plate_shortcode.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dvla-search/includes/dvla_search_error_shortcode.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dvla-search/endpoint/dvla_search_query.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dvla-search/admin/dvla_search_admin_menu.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dvla-search/includes/dvla_search_result_shortcode.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/dvla-search/includes/widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/dvla-search/public/results.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dvla-search/endpoint/dvla_search_query.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dvla-search/examples/custom_shortcode.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dvla-search/includes/dvla_search_success_shortcode.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Contributors: Plugin contributors not specified
You can take inspiration from this readme.txt

dvla-search/dvla-search.php Passed 13 tests

"DVLA Search" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
94 characters long description:
Easily add results from the DVLA Search API to your site. Requires a DVLA Search subscription.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin808 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP178313652
CSS11513156

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions27
▷ Named functions2385.19%
▷ Anonymous functions414.81%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/img/2000px-European_stars.svg.png68.82KB26.22KB▼ 61.90%
public/assets/img/euStarsSmall.png5.63KB2.32KB▼ 58.76%