Skip to main content

WordPress plugin reference

The TradeSender Enquiries plugin in full, with its shortcode, the options it stores, what it prints, what it sends and what it removes.

TradeSender Enquiries is a small WordPress plugin. It prints the embed from a shortcode and can forward Contact Form 7 submissions to the enquiry form's address. It maps no fields itself: the server reads the names.

For the steps a website owner follows, see The WordPress plugin.

At a glance

WhatValue
NameTradeSender Enquiries
Version1.0.1
Requires WordPress6.3 or later
Requires PHP7.4 or later
Tested up to in its readme7.1
LicenceGPL-2.0-or-later
Text domaintradesender-enquiries

Where it is

The zip is linked from Settings, then Website and portal, in TradeSender, and is served at:

https://app.tradesender.co.uk/downloads/tradesender-enquiries.zip

The zip is the source. It holds one folder, tradesender-enquiries, with four files and no build step:

FileWhat it is
tradesender-enquiries.phpThe whole plugin
uninstall.phpWhat runs when the plugin is deleted
readme.txtThe WordPress readme
LICENSEThe GPL, version 2

The plugin is not in WordPress's plugin directory, so WordPress offers no updates for it. A newer zip is uploaded over the old one.

The shortcode

[tradesender_enquiry]
[tradesender_enquiry accent="#2f6b3a"]
AttributeValueEffect
accentA hex colour, #rgb or #rrggbbThe colour of the Send enquiry button. Any other value is ignored.

What it prints

With a form key saved, the shortcode returns the embed's placeholder:

<div data-tradesender-enquiry="YOUR_FORM_KEY" data-accent="#2f6b3a"></div>

It also enqueues https://app.tradesender.co.uk/enquiry.js under the handle tradesender-enquiries, in the footer, with the async strategy and no version in the address. The script is added only to pages where the shortcode runs.

From there the form is the embed, with the same behaviour, event and styling.

With no form key saved, the shortcode returns an empty string. A user who can manage_options sees this in its place: "Add your TradeSender form key under Settings, TradeSender enquiries, and the enquiry form will appear here."

The settings page

The page is Settings, then TradeSender enquiries, at options-general.php?page=tradesender-enquiries. It needs the manage_options capability. The plugin also adds a Settings link to its row on the Plugins page.

Options it stores

OptionTypeHolds
tradesender_enquiries_keyStringThe workspace's form key. Empty until one is saved.
tradesender_enquiries_forward_cf7BooleanWhether Contact Form 7 submissions are forwarded. False until ticked.
tradesender_enquiries_last_errorArraymessage and time for the last forward that failed. Removed by the next one that works. Not autoloaded.

The plugin creates no tables, post types, scheduled events or REST routes.

How the key is read

The Form key field takes the key, the form link or the form address. The plugin keeps the first run of exactly 24 letters and digits it finds. If there is none, it keeps the key it had and reports "That does not look like a TradeSender form key. Copy it from TradeSender: Settings, Website and portal." Saving the field empty clears the key.

Contact Form 7 forwarding

Forwarding runs on Contact Form 7's wpcf7_before_send_mail action, when all three hold: the option is ticked, a form key is saved and Contact Form 7 is active. It covers every Contact Form 7 form on the website.

The website's server sends one multipart/form-data post to the form address, with Accept: application/json and a timeout of 15 seconds:

PartWhat is sent
The form's fieldsEach posted field under its own name, except names starting with _ and file fields
_pageThe address of the page the form was sent from
photos[]Up to 5 uploaded files that are images of 10 MB or less
  • Field names go as they are. your-name, your-email, tel-123 and the rest are matched by the server, and any other field is kept in the enquiry's message. See the enquiry form's address.
  • Contact Form 7 sends its own email whatever TradeSender answers.
  • The forward happens while the visitor waits for the form to finish.
  • Every forward comes from the server's IP address, so the limit of 10 posts in 15 minutes covers the whole website, and other websites on the same shared address.

When a forward fails

The plugin saves the reason and the time in tradesender_enquiries_last_error, and the settings page shows it as a warning until a forward works.

TradeSender answeredReason shown
404"TradeSender does not know this form key. Copy the current one from TradeSender."
429"TradeSender has had too many enquiries from this website for now."
Another status"TradeSender answered" followed by the status
No answerWordPress's own error message for the request

Point it at another server

Define TRADESENDER_ENQUIRIES_APP_URL in wp-config.php to load the script from, and post to, a server other than https://app.tradesender.co.uk. It is there for testing.

define( 'TRADESENDER_ENQUIRIES_APP_URL', 'http://127.0.0.1:3000' );

What leaves the website

WhenWhat happens
A page shows the shortcode's formThe visitor's browser loads https://app.tradesender.co.uk/enquiry.js
A visitor sends that formTheir browser posts what they typed, their photos and the page's address to https://app.tradesender.co.uk
A Contact Form 7 form is sent, with forwarding onThe website's server posts the fields, up to 5 images and the page's address to https://app.tradesender.co.uk

Nothing is sent until one of these happens.

Deactivating and deleting

Deactivating the plugin keeps its options.

Deleting it runs uninstall.php, which deletes all three options: tradesender_enquiries_key, tradesender_enquiries_forward_cf7 and tradesender_enquiries_last_error. Enquiries already in TradeSender are not touched, and shortcodes left in pages are not removed.

Checked against the app on 18 October 2026. Still stuck? Ask usAsk us.