JSON Reg Look Up (Multi-Form, Refactored)
A powerful WordPress plugin designed to integrate Gravity Forms with the ukvehicledata API. It automates vehicle information retrieval (Make, Model, Year, MOT history, etc.) based on a registration number and populates form fields dynamically. It is built to handle multiple form instances, including mobile and sidebar variations.
by Darren Kandekore · github.com/kandekore/gravity-forms-reg-lookup · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/kandekore/gravity-forms-reg-lookup/archive/refs/heads/main.zipReadme
JSON Reg Look Up (Multi-Form, Refactored) (v2.0)
A powerful WordPress plugin designed to integrate Gravity Forms with the ukvehicledata API. It automates vehicle information retrieval (Make, Model, Year, MOT history, etc.) based on a registration number and populates form fields dynamically. It is built to handle multiple form instances, including mobile and sidebar variations, with secure API key encryption and custom entry ID prefixing.
🚀 Key Features
- Automated Vehicle Lookup: Fetches comprehensive data from
ukvehicledata(VehicleAndMotHistory and VehicleImageData APIs) using just a registration number. - Dynamic Form Population: Forcibly populates both visible and hidden Gravity Forms fields with API data, including:
- Make, Model, Year, and Colour.
- MOT Expiry and Last recorded mileage.
- Technical specs like Fuel Type, Engine Capacity, CO2 Emissions, and Transmission.
- Vehicle Image URLs displayed directly in the form.
- Multi-Form Support: Configurable settings to target a "Main Form," "Mobile Form," and "Sidebar Form" simultaneously.
- Intelligent Fallbacks:
- Manual Entry: If a lookup fails, the plugin displays a validation message and reveals manual input fields for the user to complete.
- VIN Fallback: If no VIN is returned by the API, it automatically populates the VIN field with the user's phone number (cleaned of spaces).
- Custom Entry ID Prefixing: Automatically generates a unique, prefixed reference ID (e.g.,
VCM-123) for every submission. - Enterprise-Grade Security: API keys are stored in the database using OpenSSL (AES-256-CBC) encryption for maximum security.
🛠 Installation
- Upload the
gravity-forms-reg-lookupfolder to your/wp-content/plugins/directory. - Activate the plugin through the Plugins menu in WordPress.
- Navigate to Settings > RegLookup to configure your global settings.
📖 Configuration
1. API & Entry ID Settings
- ukvehicledata API Key: Enter your official API key. The plugin will encrypt this value upon saving.
- Entry ID Prefix: Define the custom prefix for your submission references (e.g.,
REF-orVCM-).
2. Gravity Forms IDs
- Enter the specific IDs for your Main, Mobile, and Sidebar forms as found in the Gravity Forms dashboard.
⚙️ Technical Details
- Version: 2.0
- Dependencies: Requires Gravity Forms to be installed and active.
- Key Hooks:
gform_post_paging: Triggers the API lookup when moving from Page 1 to Page 2.gform_pre_render: Dynamically injects vehicle images and summary lists into HTML fields.gform_after_submission: Handles the generation of the prefixed entry ID.
- Encryption: Utilizes
openssl_encryptwithaes-256-cbcwhen available.
🏷️ Suggested Topics
wordpress-plugin gravity-forms vehicle-api ukvehicledata form-automation api-integration vehicle-registration-lookup data-encryption dynamic-form-fields mot-history vin-lookup custom-entry-ids