Linux 软件免费装
Banner图

CompanyStack – UK Company Search & Directory

开发者 swilson23
更新时间 2026年10月13日 03:27
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce autocomplete business directory companies house company search

下载

1.1.2 1.2.0

详情介绍:

Customers type the first few letters of their company name, pick it from the list, and the company number and registered office address are filled in for them. No more mistyped company numbers on B2B orders, trade account applications or quote requests. The plugin works in the WooCommerce checkout, in Contact Form 7, WPForms and Gravity Forms, and in any HTML form, and it has a ready-made Company Lookup Form of its own in six designs. It also adds company profile cards, an "Active UK company" status badge and a business directory, each as a block and as a shortcode. Company data comes from the Companies House register, as held and kept up to date by the CompanyStack API. CompanyStack is an independent service: it is not affiliated with, or endorsed by, Companies House. What you get Each feature is available as a block and as a shortcode. Built to be safe and light About the CompanyStack service This plugin is an interface to the CompanyStack API (see "External services" below), which does the work of searching and serving Companies House records. You need a CompanyStack API key. The free plan needs no payment card and covers company search, autocomplete (up to 5 suggestions), company profiles, badges and directories of up to 10 results. Paid plans raise the daily request limits and allow larger, paginated directories. Every feature of the plugin works on the free plan; see companystack.co.uk/pricing for limits and prices.

安装:

  1. Install the plugin from Plugins › Add New (search for "CompanyStack"), or upload the companystack folder to /wp-content/plugins/, then activate it.
  2. Get a free API key at companystack.co.uk/signup.
  3. Go to Settings › CompanyStack, paste the key, click Test connection, then Save Changes.
  4. Add a CompanyStack block (Company Lookup Form, Company Search, Company Profile Card, UK Company Status Badge or UK Business Directory), a pattern or a shortcode to any page. The "Getting started" panel on the settings screen can make a draft page for you.
  5. Optional: choose a design and colours under Settings › CompanyStack › Appearance.
Optionally, put the key in wp-config.php instead of the database: define( 'COMPANYSTACK_API_KEY', 'cs_your_key_here' );

屏幕截图:

  • The six form designs: Clean, Soft, Underline, Card, Compact inline and Inherit theme.
  • Settings › CompanyStack › Appearance, with the live preview.
  • WooCommerce Checkout block: the Company field suggesting UK companies.
  • Contact Form 7 form filled in after choosing a company from the suggestions.
  • Company profile card and "Active UK company" status badges.
  • UK business directory with the visitor search form.
  • Settings › CompanyStack, with the getting started panel and the connection test.

升级注意事项:

1.2.0 New designs, a ready-made Company Lookup Form and an Appearance screen. Existing blocks, shortcodes and settings keep working; fields and the suggestions list get the new default look. 1.1.2 Wording and compatibility update; no changes to settings. 1.1.1 Clearer badge and source wording, needed to keep showing CompanyStack data under its updated Terms. 1.1.0 Required update: version 1.0 used an API address that has been retired. Your saved API key is carried over; check it with "Test connection" under Settings › CompanyStack.

常见问题:

Is it free?

The plugin is free and open source (GPL). It needs a CompanyStack API key; the free plan requires no card and runs every feature, with smaller limits. Paid plans are for busier sites that need more requests per day or bigger directories.

Do I need an account?

Yes: a CompanyStack API key, which is free and needs no payment card. Get one at companystack.co.uk/signup, paste it under Settings › CompanyStack and click Test connection.

Is this an official Companies House plugin?

No. CompanyStack is an independent service and is not affiliated with, or endorsed by, Companies House. The data originates from the public register under the Open Government Licence v3.0, and each card and badge links to the official record.

How does the WooCommerce integration work?

With WooCommerce active, the checkout Company field suggests UK companies, and choosing one fills in address line 1 and 2, town, county and postcode, plus the company registration number field. The number is validated and saved with the order and shown in the order screen and emails. With the Checkout block, first make the Company field visible in the block's settings. Both options can be switched off under Settings › CompanyStack.

What is the Company Lookup Form?

A complete form supplied by the plugin, as the Company Lookup Form block or [companystack_form]. It has a company name field with suggestions and the fields it fills in: company number, two address lines, town, county, postcode and company status. In the block settings (or with shortcode attributes) you choose which fields show, their labels and the placeholder. Switch on "Add a send button" (show_submit="true") and the form emails what the visitor entered to the site administrator. Nothing is saved in the database and nothing is sent to CompanyStack beyond the company search itself. Developers can handle submissions with the companystack_form_submitted action, change or reject them with the companystack_form_submission filter, change the email with companystack_form_email, or switch the email off with companystack_form_send_email. Without a send button the fields simply join any form they sit inside.

Styling: how do I change how it looks?

Three ways, from simplest to most flexible.

  1. Settings › CompanyStack › Appearance. Choose one of six designs (Clean, Soft, Underline, Card, Compact inline, Inherit theme), an accent, text and surface colour, corner radius, field size, font and how dense the suggestions list is, with a live preview. Leave colours empty to follow your theme.
  2. Per block or shortcode. Each block has a Design panel (design, corner radius, accent colour and, for blocks with fields, field size). The form, search and directory blocks also support the editor's own colour, typography, spacing and border controls; the profile card supports colour, typography and spacing. Shortcodes take preset, size, accent, text, surface and radius, for example [companystack_form preset="card" accent="#0a7d5a" radius="12"].
  3. CSS custom properties. Set any of these on :root or on a wrapper: --cstk-accent, --cstk-on-accent, --cstk-text, --cstk-muted, --cstk-surface, --cstk-border, --cstk-radius, --cstk-font, --cstk-control-height, --cstk-shadow, --cstk-space, and for status colours --cstk-ok, --cstk-ok-bg, --cstk-bad, --cstk-bad-bg, --cstk-warn, --cstk-warn-bg.
Stable class names: every component has the class cstk plus its design (cstk--clean, cstk--soft, cstk--underline, cstk--card, cstk--inline, cstk--inherit) and size (cstk--size-compact, cstk--size-regular, cstk--size-large). Fields are .cstk-input, labels .cstk-label, buttons .cstk-button. Components are .companystack-form, .companystack-search, .companystack-card, .companystack-badge, .companystack-directory and the suggestions list .companystack-ac (options .companystack-ac__option, name .companystack-ac__name, details .companystack-ac__meta). Filters: companystack_suggestion_template (the markup of one suggestion, with the placeholders {company_name}, {company_number}, {status}, {postcode} and {sic_description}), companystack_autofill_targets (which fields are filled, by CSS selector), companystack_form_fields (the lookup form's fields) and companystack_theme_accent (the accent borrowed from your theme). The suggestions list attached to Contact Form 7, WPForms, Gravity Forms and WooCommerce fields uses the site-wide design and takes its colours from the field it belongs to, so it suits dark themes without any set-up. The plugin never restyles those forms.

How do I auto-fill a Contact Form 7 form?

Add CSS classes to the form tags: [text company class:companystack-autocomplete] [text company-number class:companystack-fill-company_number] [text address class:companystack-fill-address_line_1] [text town class:companystack-fill-town] [text postcode class:companystack-fill-postcode] The script loads automatically on pages with such a form.

How do I auto-fill WPForms or Gravity Forms?

Open the field's Advanced settings and enter companystack-autocomplete in "CSS Classes" for the company name field, and companystack-fill-postcode (etc.) for the fields to fill. Available fields: company_number, address_line_1, address_line_2, town, county, postcode, country, address (the whole address on one line), company_status, company_type, date_of_creation and sic_codes.

How do I auto-fill my own HTML form?

Mark the fields with data attributes and add [companystack_autofill] (or the Company Search block) to the page: <input name="company" data-companystack-autocomplete> <input name="number" data-companystack-fill="company_number"> <input name="postcode" data-companystack-fill="postcode"> Developers can also map fields by CSS selector with the companystack_autofill_targets filter, and listen for the companystack:select browser event, whose detail.company holds the chosen company.

Which shortcodes are there?

  • [companystack_form preset="card" title="Find your company" show_number="true" show_address1="true" show_address2="true" show_town="true" show_county="false" show_postcode="true" show_status="false" show_contact="false" show_submit="false" submit_label="Send"] (labels: label, placeholder, label_number, label_address1, label_address2, label_town, label_county, label_postcode, label_status)
  • [companystack_search label="Company name" name="company_name" number_name="company_number" show_details="true"]
  • [companystack_card number="00445790" show_address="true" show_sic="true" show_filings="true"]
  • [companystack_badge number="00445790" show_name="true" link="true" show_inactive="false"]
  • [companystack_directory sic="62012" postcode="M1" town="" query="" status="active" limit="10" layout="list" show_filter="false"]
  • [companystack_autofill]
Every shortcode except the last also takes the design attributes preset, size, accent, text, surface and radius.

Is my API key exposed to visitors?

No. The key is only used by your web server. Visitors' browsers call your site's own REST endpoints (/wp-json/companystack/v1/…), which are nonce-protected and rate limited per visitor.

What data does the plugin store?

Settings (including the API key) in one option, the appearance choices in a second, a note of which welcome messages you have dismissed in a third, cached API answers and short-lived rate-limit counters as transients, and, if enabled, the company registration number on WooCommerce orders. Company Lookup Form submissions are emailed, not stored. Deleting the plugin removes everything except order data.

What happens if the service is unavailable or my limit is reached?

Forms keep working as normal text fields, cards, badges and directories are simply left out for visitors, and administrators see an explanatory notice on the page and on the settings screen. The plugin pauses requests briefly after errors so it never slows your site down.

I use full-page caching. Will search still work?

Search requests carry a WordPress nonce, which is valid for up to 24 hours. If your cache keeps pages longer than about 12 hours, exclude the pages with company search forms (for example the checkout) or lower the cache lifetime. Cards, badges and directories are rendered on the server and cache normally.

My site is behind a proxy or CDN. Is rate limiting per visitor?

By default the limit uses the connecting IP address, which behind a proxy may be the proxy's. If your proxy sets a trusted header, return the real address with the companystack_client_ip filter.

更新日志:

1.2.0 1.1.2 1.1.1 1.1.0 1.0.0