Skip to content

Releases: s-a-s-k-i-a/betterplace-donation-embed

v0.1.5 — Mobile media-query now actually fires

Choose a tag to compare

@s-a-s-k-i-a s-a-s-k-i-a released this 21 May 17:19

Follow-up to v0.1.4: the smartphone media query was being beaten by the wrapper's inline width:600px style (inline CSS has higher specificity than <style> rules). v0.1.5 emits both width rules in the per-instance <style> block, so they share specificity and the media query overrides the base rule naturally on viewports narrower than the configured width.

All CI green (PHPUnit 14 matrix combos, Playwright, Smoke, Lint).

v0.1.4 — Mobile responsiveness + auto-update fix

Choose a tag to compare

@s-a-s-k-i-a s-a-s-k-i-a released this 21 May 16:56

Two bug-fixes: smartphone-responsive width + auto-activate license for working auto-updates.

What's fixed

1. Smartphone responsiveness

In v0.1.3 the wrapper used a fixed width: <user-px> to propagate the desired size up through Divi-Pixel-popup flex parents. That worked on desktop but caused horizontal overflow on viewports narrower than the configured width — on a 375px phone, a 600px-configured iframe would still try to be 600px and would overflow its popup.

Fix: each rendered instance now emits a per-instance class plus a scoped inline <style> block:

<style>@media (max-width: 600px) { .bpde-embed--i1 { width: 100%; } }</style>
<div class="bpde-embed bpde-embed--i1" style="width:600px;max-width:100%;…">

On viewports narrower than the configured width, the wrapper collapses to width: 100% and the iframe fills the available space. On wider viewports, the v0.1.3 flex-chain fix continues to work.

Per-instance class names (bpde-embed--i1, --i2, …) ensure that two blocks/shortcodes on the same page with different configured widths each get their own breakpoint.

2. Auto-update never reached the download

v0.1.2 + v0.1.3 wired up EDD_SL_Plugin_Updater, but the EDD-SL package_download endpoint also requires the license to be activated for the requesting site's home_url(). Without activation it returns HTTP 401 and the WordPress update click fails with "Aktualisierungs-Paket nicht verfügbar".

Fix: a new bpde_maybe_activate_license() runs on admin_init, POSTs edd_action=activate_license once per site, stores the result in the bpde_license_activation option. Idempotent — only re-runs when home_url() changes or after 30 days. Quiet failure path (next admin_init retries).

After updating to v0.1.4, subsequent updates from this release onward will install via the WordPress UI without manual intervention.

CI status

PHPUnit ✓ (14 PHP × WP matrix combinations) — Smoke ✓ — Playwright E2E ✓ — WPCS Lint ✓

v0.1.3 — Fix iframe width in flex parents (Divi popup bug)

Choose a tag to compare

@s-a-s-k-i-a s-a-s-k-i-a released this 21 May 16:21

Bug-fix release — iframe width inside flex containers (e.g. Divi Pixel popups).

What's fixed

When the shortcode or block was used inside a display: flex container — for example a Divi Pixel popup, whose .dipi-popup-wrapper is a flex container — the iframe shrank to the intrinsic width of the fallback link below it (~320 px), regardless of the configured width setting (e.g. 600 px in the plugin admin).

Root cause: the wrapper used only max-width: <px>. Inside a flex container, a block descendant gets sized to its content's intrinsic width because flex items default to flex-basis: auto and don't stretch their children. A max-width alone doesn't help — there's nothing forcing the child to be wider than its content.

Fix: the wrapper now also sets width: <px> (the configured value), with max-width: 100% to keep it responsive on narrow viewports. The explicit width propagates up the ancestor chain (every block parent grows to accommodate its child's stated width), reaching the flex item, which then claims the configured size from the flex container.

Affected setups

  • Any plugin instance rendered inside a Divi Pixel popup
  • Any other display: flex parent where block descendants would otherwise collapse to content width

Regular page layouts (Gutenberg blocks, classic content) were not affected — the wrapper already used 100% of its parent's width.

Regression test

Added Test_Renderer::test_render_wrapper_uses_explicit_width_and_responsive_max_width to pin the new wrapper-style format so this can't regress silently.

CI status

PHPUnit ✓ (14 PHP × WP matrix combinations) — Smoke ✓ — Playwright E2E ✓ — WPCS Lint ✓

v0.1.2 — Zero-config auto-updates

Choose a tag to compare

@s-a-s-k-i-a s-a-s-k-i-a released this 21 May 14:21

Zero-config auto-updates — no license-key entry required.

What's new

v0.1.1 wired up the EDD Software Licensing update client but still required an explicit license key to receive update packages — which is how EDD-SL is designed. For a freely-distributed plugin that's friction without value, so v0.1.2 bakes in a single shared license key (configured at the isla studio store as unlimited activations / never-expires).

Effect: install the ZIP, activate, done. The plugin checks https://isla-stud.io for updates and surfaces them in Plugins → Installed Plugins like any other WordPress plugin — without any UI configuration by the end user.

Is the baked-in license a problem?

No — it's deliberately public. The key only grants access to download a free plugin we already give away. There is nothing to gate.

Override for self-hosters

// in wp-config.php
define( 'BPDE_EDD_LICENSE_KEY', 'your-own-key' );

or via filter:

add_filter( 'bpde_license_key', fn() => 'your-own-key' );

To opt out of update checks entirely:

define( 'BPDE_DISABLE_UPDATER', true );
// or
add_filter( 'bpde_disable_updater', '__return_true' );

CI status (this release)

PHPUnit ✓ (14 PHP × WP combinations) — Smoke ✓ — Playwright E2E ✓ — WPCS Lint ✓

v0.1.1 — Auto-update via isla studio EDD store

Choose a tag to compare

@s-a-s-k-i-a s-a-s-k-i-a released this 21 May 12:43

Minor release — adds auto-update support via the isla studio EDD store.

What's new

Installed copies of the plugin now check https://isla-stud.io (item ID 3610) for new versions and surface updates in Plugins → Installed Plugins like any other WordPress plugin. No license key is required — the EDD product is configured as a free download.

This wires up the standard EDD Software Licensing client (EDD_SL_Plugin_Updater, vendored from awesomemotive/easy-digital-downloads v1.9.1) against the isla studio store. Update files themselves are still served from this GitHub release (via the EDD Git Download Updater addon on the store side), so the source of truth doesn't change.

Opt-out

Sites that block outbound HTTP or want to manage updates manually can disable the updater:

// in wp-config.php
define( 'BPDE_DISABLE_UPDATER', true );

or via filter:

add_filter( 'bpde_disable_updater', '__return_true' );

Install / Upgrade

  • Recommended: download from isla-stud.io/downloads/betterplace-donation-formular-fuer-wordpress and install via Plugins → Add New → Upload Plugin (auto-updates included).
  • Or: download betterplace-donation-embed-0.1.1.zip below and install the same way (no auto-updates unless you reinstall the store version).
  • Upgrading from v0.1.0: just install the new ZIP on top — settings + content are preserved.

CI status (this release)

  • PHPUnit ✓ (PHP 7.4–8.3 × WP 6.0/6.5/latest, 14 combinations)
  • Smoke ✓ (curl shortcode-rendered post, asserts no upstream loader anywhere)
  • Playwright E2E ✓ (Chromium against wp-env)
  • WPCS Lint ✓

Full changelog

See readme.txt.

v0.1.0 — Embed betterplace donation form via shortcode + Gutenberg block

Choose a tag to compare

@s-a-s-k-i-a s-a-s-k-i-a released this 21 May 12:11

First stable release — embed the betterplace.org donation form via a WordPress shortcode and a Gutenberg block, without depending on the upstream load_donation_iframe.js loader.

What this plugin does

The portal-generated betterplace iframe snippet ships a remote classic script that declares ~150 single-letter const/let/function identifiers at top level — including a bare $. Those identifiers land in the page's global lexical environment, shared across all classic scripts in the realm. As soon as any other script on the page also declares let/const/class $ at top level (a browser extension, a second iframe-resizer instance, a build artefact from another plugin), parsing fails at load time with:

Uncaught SyntaxError: Identifier '$' has already been declared

Because that's a parse-time error, the loader never runs and the donation iframe is sometimes never injected at all — the embedding <div> stays at the spinner forever.

This plugin sidesteps the whole loader by rendering a static <iframe> with the same URL shape that getIframeSource() in the loader builds (verified upstream against load_donation_iframe.js). No JavaScript loaded, no global pollution.

Features

  • Shortcode[betterplace_donation project_id="4667" color="6c9c2e" default_amount="10"]
  • Gutenberg block — "Betterplace-Spendenformular" with a live preview in the editor and full sidebar controls (project ID, color, amount, interval, payment method, language, dimensions)
  • Settings page — site-wide defaults under Settings → Spendenformular
  • Sanitized output — hex-color validation, amount clamped to 1–99, allow-listed default_interval and default_payment_method (incl. upstream's eft → stripe_sepa_debit remap), iframe dimensions clamped to sane bounds, fully escaped HTML output
  • Lazy-loaded with loading="lazy" + referrerpolicy="strict-origin-when-cross-origin"
  • Fallback link rendered below the iframe for Adblockers / CSP cases
  • i18n-ready (text domain betterplace-donation-embed, German strings, English strings via gettext)

Installation

  1. Download betterplace-donation-embed-0.1.0.zip (attached below).
  2. In WordPress: Plugins → Add New → Upload Plugin → select the ZIP → Install Now → Activate.
  3. (Optional) Configure site-wide defaults under Settings → Spendenformular.
  4. Drop the shortcode [betterplace_donation project_id="<your betterplace project ID>"] into a post / page, or insert the Betterplace-Spendenformular block in the block editor.

Requirements

  • WordPress 6.0+
  • PHP 7.4+

Test coverage

CI matrix passing on this release:

  • PHPUnit: PHP 7.4 / 8.0 / 8.1 / 8.2 / 8.3 × WP 6.0 / 6.5 / latest (14 combinations)
  • Smoke (bash tests/smoke/smoke.sh against wp-env): activates plugin, renders shortcode in a real post, asserts the iframe markup is present and load_donation_iframe.js is not referenced anywhere in the page HTML
  • Playwright E2E (Chromium against wp-env): frontend iframe rendering, sanitized attributes, fallback link, negative test confirming the upstream loader URL is never loaded
  • Lint: WPCS via phpcs.xml.dist

Upstream context

The upstream loader behaviour is documented in a docs-only PR at betterplace/betterplace_apidocs#11. Recommended upstream fix: wrap the served bundle in an IIFE ((function(){…})();) — moves all top-level declarations into a function scope, no global pollution.

License

GPL-2.0-or-later — see LICENSE in the ZIP.