Gravity Forms TOPS / TowX Integration
TOPS / TowXchange integration for Gravity Forms.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/duppinstech/gravity-forms-tops/archive/refs/heads/main.zipWordPress plugin by Duppins Technology that connects Gravity Forms to the TowX / TOPS (TOPSLink) API for tow dispatch (Create Call XML), with per-form field mapping and dynamic vehicle dropdowns.
Ownership and licensing to clients are described in OWNERSHIP.md.
Repository layout
| Path | Purpose |
|---|---|
gravity-forms-tops.php |
Bootstrap, constants, TLS helper registration, add-on registration |
uninstall.php |
Removes plugin options, cached transients and the request-log table (every site on multisite); keeps per-form settings |
includes/class-gf-tops-addon.php |
Gravity Forms add-on: settings, field map, submission, AJAX, request-log screen |
includes/class-gf-tops-xml.php |
Create Call XML build, redaction, POST, response parsing |
includes/class-gf-tops-entry.php |
Entry values, addresses, names, VehicleInfo |
includes/class-gf-tops-secrets.php |
Encryption of TowX password / authentication key at rest |
includes/class-gf-tops-request-log.php |
Request-log database table |
includes/class-gf-tops-privacy.php |
Privacy-policy text and personal-data export / erase for the request log |
includes/class-gf-tops-http.php |
TLS / cURL adjustments for TowX hosts |
includes/class-gf-tops-github-updater.php |
GitHub Releases updater (reference implementation of the shared standard) |
assets/ |
Front-end model cascade and admin connection-test scripts and styles |
languages/ |
Translation template (gravity-forms-tops.pot, regenerated by the release workflow) |
docs/ |
Developer documentation: hooks reference, updater standard (not shipped) |
tests/, bin/, composer.json, phpcs.xml.dist, phpunit.xml.dist |
Development tooling (not shipped in the release ZIP) |
Requirements
- WordPress 6.2+
- PHP 7.4+
- Gravity Forms 2.5+ (active, licensed)
Install
- Install the
gravity-forms-tops.zipfrom the latest GitHub release (or copy this repository intowp-content/plugins/gravity-forms-tops/). - Activate Gravity Forms TOPS / TowX Integration in Plugins.
- Follow the step-by-step Setup guide, troubleshooting FAQ and request-log status glossary in readme.txt (shown in WordPress under View details).
Later releases are offered through the normal WordPress Plugins → Updates screen, including background auto-updates. The updater follows the shared Duppins Technology GitHub updater standard; this repository holds its reference implementation. Define GF_TOPS_DISABLE_GITHUB_UPDATER as true to turn it off.
Features
- Field map for Create Call data (plus optional lines prepended to dispatch notes). VehicleInfo is built from the Year, Make, Model, and Color choice labels.
- Live vehicle lists: Make and Color selects are filled from TowX GetMakes / GetColors; Model is loaded with GetModelsForMake when a make is chosen. Lists are cached for one hour (filter
gf_tops_vehicle_list_cache_ttl). - Credentials: password and authentication key are encrypted at rest and never re-displayed; leave blank to keep the stored value.
- Test authentication runs GetMakes and shows a summary plus detailed response on failure.
- Request log (Forms → TOPS log, kept 90 days by default) with redacted request XML, TowX responses, and Resend Create Call (view requires Gravity Forms' view-entries permission; resend requires edit-entries).
- Setup checklist on each form's TOPS tab, including the last failed TowX lookup.
- Privacy: suggested privacy-policy text and personal-data export / erase for request-log rows.
- TLS helpers for
towxchange.nethosts (filtersgf_tops_http_*).
Production notes
- Page caching: the model dropdown uses an AJAX nonce. If a full-page cache serves tow-form pages for longer than 12 hours, exclude those pages from the cache (preferred), or return
falsefromgf_tops_models_require_nonce. - Diagnostics: the `
footer comment appears only when browser console logging orWP_DEBUGis on (filtergf_tops_show_footer_diagnostic_comment`). - Request log retention: log rows include customer details from the submission and are deleted after 90 days by a daily WP-Cron task (Forms → Settings → TOPS → Keep request log for, 0 keeps them forever; filter
gf_tops_request_log_retention_days). Gravity Forms entries are not affected. Rows can also be erased per person through WordPress's privacy tools. - Outages: after a failed TowX lookup, lookups pause for 90 seconds per credential set (
gf_tops_lookup_failure_backoff). - Logging: with Logging on, messages go to the PHP error log with the prefix
[GF TOPS](the host must have PHP error logging enabled). - Hooks: see docs/hooks.md.
Development
Composer is used for development tooling only; the plugin has no runtime dependencies.
composer install # dev tools
composer lint # php -l on every plugin PHP file
composer phpcs # WordPress security / i18n / PHP 7.4+ compatibility sniffs
composer test # PHPUnit unit tests (no WordPress or credentials needed)
composer check # all of the above
bash bin/build-zip.sh # build gravity-forms-tops.zip locally (needs zip)
bash bin/release-notes.sh 1.5.0 gravity-forms-tops.php /tmp/notes.md # preview the release notes
CI (.github/workflows/ci.yml) runs these on PHP 7.4–8.4. Pushing a v* tag on a commit that is on main runs .github/workflows/release.yml: a read-only build job checks the tag against the plugin version, re-runs lint and tests, regenerates the translation template and builds the ZIP; a separate publish job (environment release) attests build provenance and attaches the ZIP to the GitHub release, with release notes made of the requirements plus this version's readme.txt changelog section (bin/release-notes.sh; CI runs it on every PR, so a version bump without its changelog section fails early). Actions are pinned to commit SHAs.
Support
Email support@duppinstech.com. Include the details listed under "What should I send when asking for support?" in readme.txt, and never send TowX credentials.
Security
See SECURITY.md. TowX password and authentication key are encrypted at rest in form meta; User ID and Session ID are not. Limit form-admin access and use HTTPS.
License
GPL-2.0-or-later. See LICENSE. Copyright Duppins Technology.
Legal
Gravity Forms is a trademark of Rocketgenius, Inc. This project is not affiliated with or endorsed by Rocketgenius or TowXchange. TowX / TOPS are used here to describe API compatibility only.