Octany widgets in WordPress.
The Octany plugin adds a block and a shortcode that embed any Octany widget — donation flows, 1-click Swish, donation goals, activity feeds, Pulse, greetings, client portals and forms — in posts and pages. Editors don't need permission to add scripts: the plugin writes the embed snippet itself, and only loads it from Octany's own servers.
§ 01.7.1 Download #
| Version | 0.1.0 |
| Requires WordPress | 6.5 or later (tested up to 7.1) |
| Requires PHP | 7.4 or later |
| Languages | English, Swedish |
| License | GPLv2 or later |
| SHA-256 | 4741f6a830acf3287bb5c94f68a06b342b2f37858954f9e1d9ea0f26339502fe |
§ 01.7.2 Install and update #
- In WordPress admin, go to Plugins → Add New Plugin → Upload Plugin.
- Choose the downloaded zip and click Install Now.
- Click Activate.
The plugin isn't on WordPress.org, so updates don't show up in the dashboard. To update, download the new zip here and upload it the same way — WordPress asks whether to replace the installed version. Blocks and shortcodes already on your pages keep working.
§ 01.7.3 Block #
- In Octany admin, open the widget and copy its embed code.
- In the block editor, add the Octany widget block (under Embeds, or search for "octany", "donate" or "swish").
- Paste the embed code and click Embed.
The block reads the widget type, account, widget ID, language and references out of the embed code, so you never type them by hand. After that, everything can be changed in the block settings sidebar: Type, Account ID and Widget ID under Widget; Octany URL, Language, Reference ID and Reference name under Advanced. Use Replace in the block toolbar to paste a different embed code.
The editor shows a placeholder — the widget itself renders when the page is viewed. The block supports wide and full alignment and margin spacing.
§ 01.7.4 Shortcode #
For the classic editor, page builders, widget areas, or anywhere else shortcodes work:
[octany type="donate-v1" account="1234" widget="01HXXXXXXXXXXXXXXXXXXXXXXX"]
| Attribute | Required | Description |
|---|---|---|
| type | Yes | The widget type, see Widget types. |
| account | Yes | Your Octany account ID. Digits only. |
| widget | Yes | The widget ID, 26 characters. For forms, the form ID. |
| url | No | The Octany app the widget talks to. Defaults to https://app.octany.com. |
| lang | No | Two-letter language code, e.g. sv or en. Empty uses the widget's language. |
| reference_id | No | Passed to the loader as referenceId and stored on orders from the widget. See Attribution. |
| reference_name | No | Passed as referenceName: a human-readable label for the reference. |
A shortcode pasted into the block editor can be converted to an Octany widget block with the block's Transform menu — all attributes carry over.
§ 01.7.5 Widget types #
| type | Widget | Loader path | Container class |
|---|---|---|---|
| donate-v1 | Donation flow | donate-v1 | .octany-donate |
| swish-v1 | 1-click Swish | swish-v1 | .octany-swish-widget |
| target-v1 | Donation goal | target-v1 | .octany-target-widget |
| feed-v1 | Activity feed | feed-v1 | .octany-feed-widget |
| pulse-v1 | Pulse | pulse-v1 | .octany-pulse-widget |
| greeting-v1 | Greeting | greeting-v1 | .octany-greeting-widget |
| portal-v1 | Client portal | portal-v1 | .octany-portal-widget |
| form-v1 | Form | registration-v1 | .octany-registration-widget |
Forms are the one exception to the naming: the shortcode type is form-v1, the loader is registration-v1, and the api URL gets a /forms suffix.
§ 01.7.6 Output and validation #
The block and the shortcode render the same markup Octany admin hands out — a container and a module script, in place:
<!-- [octany type="donate-v1" account="1234" widget="01HXXXXXXXXXXXXXXXXXXXXXXX" lang="sv"] --> <div class="octany-donate" data-widget="01HXXXXXXXXXXXXXXXXXXXXXXX"></div> <script type="module" src="https://give.octany.com/donate-v1/loader.js?api=https%3A%2F%2Fapp.octany.com%2Fwidget%2F1234&widget=01HXXXXXXXXXXXXXXXXXXXXXXX&lang=sv" ></script>
Nothing is rendered — no error, no empty container — when a value is missing or invalid:
typemust be one of the widget types.accountmust be digits only.widgetmust be 26 letters and digits.url, if set, must behttps://onoctany.comor a subdomain, with no path, query or credentials.localhostis also allowed for development.
An invalid lang is dropped rather than failing the embed. Reference values are sanitized as plain text.
give. host next to the app URL: https://app.octany.com loads from https://give.octany.com. Donor details and data-terms-accepted from Fundraising are not exposed as block settings — if you need them, render the snippet yourself in your theme.
§ 01.7.7 Developer filters #
| Filter | Default | Use it to |
|---|---|---|
| octany_domains | ['octany.com', 'localhost'] | Change which hosts url may point at. Subdomains of each entry are allowed. |
| octany_loader_origin | https://give.{host} | Serve loaders from somewhere else. Receives the origin and the validated app URL. |
// Allow a staging Octany in addition to production. add_filter('octany_domains', function (array $domains) { $domains[] = 'octany.test'; return $domains; });