Skip to content

PMPro Donations v3.0 — bug fixes, enhancements, new features#93

Open
flintfromthebasement wants to merge 8 commits intostrangerstudios:devfrom
flintfromthebasement:v3.0
Open

PMPro Donations v3.0 — bug fixes, enhancements, new features#93
flintfromthebasement wants to merge 8 commits intostrangerstudios:devfrom
flintfromthebasement:v3.0

Conversation

@flintfromthebasement
Copy link
Copy Markdown

Overview

This branch contains all v3.0 work across three phases: bug fixes, enhancements, and ideas meeting features.

What's Included

Bug Fixes

  • Replace (double) casts with (float) for PHP 8.5 compatibility
  • Enable payment gateways for free levels when donations are present
  • Prevent donation-only level from replacing/canceling a user's existing membership — restores previous level post-checkout, cancels donation-only level for new/guest users

Merged PRs

Enhancements (TICKETS 04–07)

  • Confirmation/thank you language updates for donation-only levels
  • Donor notes field at checkout
  • Admin donation amount field
  • Guest donation support

Ideas Meeting Features (TICKETS 08–14)

  • Donation amount buttons (styled, per-level configurable)
  • "Cover processing fees" checkbox with dynamic fee display
  • Better donation-only level experience (language, account page, level group awareness)
  • Per-level email/confirmation template overrides with !!donation!! and !!donation_note!! variables

Hardening

  • Revision pass on HomurAI-generated output
  • Additional hardening pass on v3.0 donation flows

How to Test

  1. Set up a donation-only membership level
  2. Test checkout as a guest, new user, and existing member — confirm existing memberships are preserved post-donation
  3. Test donation amount buttons at checkout
  4. Test "cover fees" checkbox with Stripe/PayPal
  5. Test donor notes field — confirm stored in order meta
  6. Confirm per-level email templates fire correctly

Notes

  • This is a draft PR for review — needs QA before merging to dev
  • Some features (email templates) may overlap with PMPro core email system — worth a second look before shipping

The (double) cast alias is deprecated in PHP 8.5. Replace all 6
occurrences with the canonical (float) cast. Zero behavioral change.

Closes strangerstudios#90
When a free membership level has donations enabled with a min_price > 0
or dropdown prices containing numeric values, mark the level as non-free
so payment gateway fields render on checkout.

Also adds validation requiring a donation amount for free levels with
a minimum donation configured.

Closes strangerstudios#84
Rewrite donation-only checkout flow to use PMPro API instead of raw SQL.
Store user's previous levels before checkout, then restore after checkout
using pmpro_cancelMembershipLevel() + pmpro_changeMembershipLevel().

Adds level group awareness so the correct level is restored when multiple
groups exist. Also suppresses the misleading "your membership will be
removed" message on donation-only checkout via gettext filter.

Closes strangerstudios#85
Includes:
- Fix donation amount storage for Pay by Check + whitespace (ticket 04)
- Built-in donations report with filtering and CSV export (ticket 05)
- Donor note field at checkout with email integration (ticket 06)
- Admin donation amount field on order edit + Add Member (ticket 07)
- Donation amount button tiles UI at checkout (ticket 08)
- Cover processing fees checkbox at checkout (ticket 09)
- Guest donations without account creation (ticket 10)
- Donation reminder emails on configurable schedule (ticket 11)
- Donation-only level experience overhaul (ticket 12)
- Per-level email and confirmation template overrides (ticket 13)
- Static analysis / QA verification (ticket 14)

Code generated by homurai (v0.8.0-beta.9). Revision pass pending.
- Fix plugin header version (2.2 → 2.3) and readme.txt stable tag
- Add v2.3 changelog to readme.txt
- Fix i18n: email string replacements now use __() with PMPro core
  text domain so they work on non-English sites
- Fix JS toggle bug: toggling "Enable Donations" now re-applies
  sub-toggle states (note label, cover fees, display mode, guest)
- Suppress cancellation emails during donation-only level swap to
  prevent confusing "membership cancelled" emails during donations
- Add error_log() if pmpro_changeMembershipLevel() fails during
  level restoration
- Replace deprecated JS substr() with substring()
- Fix add_filter arg count on pmprodon_filter_guest_donor_email
@dparker1005
Copy link
Copy Markdown
Member

The “guest checkout” isn’t really a guest checkout because a user is still created. If you try to donate again using that same email at checkout, it will fail because a user already exists with that email. So this feature is more of a “streamlined checkout”.

As a result, I feel like this is a feature that is not just donations-specific, but useful for all of PMPro and something that we’ve talked about in the past. Should “streamlined checkout” be more of a core feature then? Maybe advanced settings that apply globally, and level-specific overrides for donations levels and such?

It just feels like if we build this feature into donations, it’s eventually going to be generalized especially since we already have code recipes for this type of feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants