Octany. for/devs
§ 01 — Fundraising · WordPress

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 #

Octany for WordPress
v0.1.0 · zip · 14 KB
Download plugin
Version0.1.0
Requires WordPress6.5 or later (tested up to 7.1)
Requires PHP7.4 or later
LanguagesEnglish, Swedish
LicenseGPLv2 or later
SHA-2564741f6a830acf3287bb5c94f68a06b342b2f37858954f9e1d9ea0f26339502fe

§ 01.7.2 Install and update #

  1. In WordPress admin, go to Plugins → Add New Plugin → Upload Plugin.
  2. Choose the downloaded zip and click Install Now.
  3. 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 #

  1. In Octany admin, open the widget and copy its embed code.
  2. In the block editor, add the Octany widget block (under Embeds, or search for "octany", "donate" or "swish").
  3. 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"]
AttributeRequiredDescription
typeYesThe widget type, see Widget types.
accountYesYour Octany account ID. Digits only.
widgetYesThe widget ID, 26 characters. For forms, the form ID.
urlNoThe Octany app the widget talks to. Defaults to https://app.octany.com.
langNoTwo-letter language code, e.g. sv or en. Empty uses the widget's language.
reference_idNoPassed to the loader as referenceId and stored on orders from the widget. See Attribution.
reference_nameNoPassed 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 #

typeWidgetLoader pathContainer class
donate-v1Donation flowdonate-v1.octany-donate
swish-v11-click Swishswish-v1.octany-swish-widget
target-v1Donation goaltarget-v1.octany-target-widget
feed-v1Activity feedfeed-v1.octany-feed-widget
pulse-v1Pulsepulse-v1.octany-pulse-widget
greeting-v1Greetinggreeting-v1.octany-greeting-widget
portal-v1Client portalportal-v1.octany-portal-widget
form-v1Formregistration-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:

An invalid lang is dropped rather than failing the embed. Reference values are sanitized as plain text.

Loader origin Loaders come from the 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 #

FilterDefaultUse it to
octany_domains['octany.com', 'localhost']Change which hosts url may point at. Subdomains of each entry are allowed.
octany_loader_originhttps://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;
});