Donation Manager
WordPress plugin for capturing donation pick up requests.
by Michael Wender · github.com/smcothrift/donation-manager · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/smcothrift/donation-manager/archive/refs/heads/main.zipA complete donation intake system for WordPress.
Changelog
5.7.1
- Fix GA4 donation_completed event re-firing on refresh of the thank-you page (session persistence bug).
5.7.0
- GA4 Conversion tracking for completed donations.
- Replace Grunt with Composer scripts for readme/pot generation
- Update ignore files for the new readme/pot build tooling
- Add missing text domain in required-checks.php notice string.
5.6.1
- Updating language in Donor Confirmation email (changing references to "donation" to "pickup request").
5.6.0
Version 5.6.0 delivers major backend improvements focused on session management, redirect handling, and debugging capabilities. The donation form submission handler has been completely rewritten to process requests more reliably, moving from the init hook to template_redirect to eliminate duplicate processing and ensure predictable behavior throughout the multi-step donation flow.
Session handling is now centralized through new utility functions that guarantee secure session initialization, preserve donor state across redirects, and prevent accidental data loss. Enhanced debugging provides flow-based tracking with unique request IDs, making it easier to trace individual donor journeys through server logs. The CHHJ integration has been updated to post to their new API endpoint with automatic account type detection based on donor information.
- Complete rewrite of form submission handler, moved from
inittotemplate_redirecthook for more reliable processing. - Enhanced routing logic with better step detection and redirect bounce protection.
- New
donman_start_session()utility for centralized, secure session initialization with static guards and secure configuration. - New
donman_safe_redirect()utility for preserving donor session state during navigation with comprehensive debug logging. - Hardened session reset logic that prevents accidental data loss during active donation flows using
_in_flowflag tracking. - Added
_recent_redirect_reffor improved redirect reference tracking. - Added
resetattribute to[donationform]shortcode for manual session clearing. - Updated CHHJ API integration to post to new endpoint defined via
CHHJ_API_EPandCHHJ_API_TOKENconstants. - Dynamic account type detection (commercial vs. residential) based on presence of company name in donation.
- Flow-based debugging with unique request IDs (UUIDs) for tracking individual donor sessions across redirects.
- Enhanced
uber_log()with session-aware header printing, color-coded output, and improved timestamp formatting. - SECURITY: Replaced all
header()redirect calls with WordPresswp_safe_redirect()across all callback files. - Added
isset()checks for company name, pickup location, and session variables to prevent PHP notices. - Improved
$nextpageURL handling with validation for empty/null attributes and external URLs. - Updated contact details form field label from "Phone" to "Mobile Phone" for clearer donor expectations.
5.5.0
- Initial implementation of new CHHJ API.
- BUGFIX: When an organization had their settings set to "Skip Screening Questions", we were unsetting
$_SESSION['donor']. To fix, we are now setting$_SESSION['donor']['_redirecting']and testing for that before unsetting the donor array.
5.4.5
- Correctly calling
acf_add_options_page()insideacf/inithook. Removes "Notice: Function _load_textdomain_just_in_time was called incorrectly."
5.4.4
- When running
wp dm archive <year> --month=<month>, allow for setting the number of months back we can archive donations viaDM_ARCHIVE_LIMIT.
5.4.3
- Adjusting defaults for
wp dm supabase sync donationswith$start_date=yesterdayand$end_date=todayif no values passed.
5.4.2.5
- BUGFIX: Adding missing parenthesis.
5.4.2.4
- BUGFIX: Don't validate start/end dates if not set.
5.4.2.3
- Only logging warnings/errors for
wp dm supabase sync donations.
5.4.2.2
- Indicating number of found donations when running
wp dm supabase sync donations.
5.4.2.1
- BUGFIX: Fixing test for $total_donations in
wp dm supabase sync donations.
5.4.2
- Adding
$testargument toDonationManager\Organizations\get_priority_organizations(). - Adjusted output of
wp dm supabase sync donationsto show a progress bar followed by log entries.
5.4.1
- Adding
start_dateandend_dateoptions towp dm supabase sync donations.
5.4.0
- Supabase sync for Donation CPTs via
wp dm supabase sync donations. - Specify the limit for Supabase syncing via the
--limit=<limit>parameter. Currently works fordonations.
5.3.4
- Removing Dashicons for frontend users.
5.3.3
- Loading
user-dashboard.cssonly when user is logged in.
5.3.2
- Removing enqueue for HTMX in favor of the plugin enqueuing.
5.3.1
- Loading HTMX locally.
5.3.0
- Supabase syncing for Organizations and Transportation Departments via WP CLI (
wp dm supabase). - Declare
orphaned_donations_hookto fix PHP 8.2 warning.
5.2.0
- Updating social links in Donor Confirmation, Monthly Donor Report, and Transportation Department Notification emails.
- Adding
{{year}}variable to email footers to allow for dynamic insertion of current year in the copyright notice. - Adding
--forceand--orgsoptions to$ wp dm report. - BUGFIX: Admin alerts for
invalid_link,missing_org_transdept_notification, andzipcode_mismatchupdated to utilize the "User Portal Notification" template. Previously they were set to use the legacy "Blank Template" which no longer exists resulting in an empty email which generated a fail over our transactional email API. - BUGFIX: Correcting redirect for an
invalid_linkto return to the home page.
5.1.0
- Not adding alert styling to Step 1 Note when alert HTML is already present.
- Adjusting "Prices start as low" text from "$50" to "$100".
- Adding documentation for
[getalert/]shortcode.
5.0.0
- Saving
api_post_timestamp.
4.9.6
- BUGFIX: Correcting variable collision in
cli.resend.php.
4.9.5
- BUGFIX: Correctly referencing variable for
$pickup_codeincli.resend.php.
4.9.4
- BUGFIX: Adding namespacing for
get_organizations()call incli.resend.php.
4.9.3
- Setting "api" routing method when resending donations with PickUpMyDonation.com as the Org.
4.9.2
- Updating Communications Consent notice.
4.9.1
- Setting
api_response_code=pendingwhen attempting to resend a donation viawp dm resend.
4.9.0
- Adding
wp dm resendfor resending failed API posts.
4.8.5
- Correcting storage logic for cURL Gateway Timeouts.
- Removing "Reason" column from "Fails" table for
wp dm stats priority.
4.8.4
- Update API Save Response Code to 408 when Response Message contains "cURL error 28: Operation timed out".
4.8.3
- BUGFIX: Preventing division by zero in
wp dm stats prioritywhen no donations have been recorded for an organization.
4.8.2
- BUGFIX: Updating variable naming in
wp dm stats priority.
4.8.1
- BUGFIX: Correctly storing donation stats with
wp dm stats priority.
4.8.0
- Adding
wp dm stats priorityfor generating priority partner stats.
4.7.3
- Storing 1800GJ API Response->body->message in
api_response_message.
4.7.2
- Adding 1800GJ API Stats widget.
4.7.1
- Adding "The Good Truck" to
wp dm fixallzips.
4.7.0
- Saving
api_methodwhen posting to an API. This paves the way for a rewrite of our stats code.
4.6.0
- Now sending API submissions for Orphaned Donations.
4.5.6
- Updating post timeout from 10 to 15s for 1800GJ API.
4.5.5
- Fixing conditional statement so that emails are still sent when posting to 1800GJ API.
- Addressing unset variables during "Skip Pick Up Dates" donation flow.
4.5.4
- Compiling HBS templates with
sms_consent_note.
4.5.3
- Adding SMS Consent note.
4.5.2
- Adding additional data sanitization for GOTJUNK API posts.
4.5.1
- Checking for and using
GOTJUNK_API_EPwhen sending an API post for 1-800-Got-Junk.
4.5.0
- Adding API Routing for 1-800-GOT-JUNK.
4.4.6
- Major update to
get_organizations(): We are removing leading "zeros" from pickup codes. So, if a donor searches on01420,get_organizations( "01420" )will search for Transportation Departments which have "1420" as their assigned zip code. - Updating
wp dm fixzipsto remove leading "zeros" during import of zip codes from a CSV. - Adding
wp dm fixallzipsto process all CSVs found in the Franchisee Maps directory. - Adding
--hidefranchiseelistoption towp dm fixzips. - Adding
--hidetableoption towp dm fixzips. - Fixing: "Using ${var} in strings is deprecated, use {$var} instead"
4.4.5.2
- BUGFIX: Updating check for building
$edit_urlinget_organizations()so that edit link for Priority Orgs will show for logged in admins.
4.4.5.1
- BUGFIX: Newer versions of Bower require
nameto be lowercase with no spaces. Changed"name": "Donation Manager WordPress Plugin"to"name": "donation-manager-wordpress-plugin"in bower.json.
4.4.5
- Custom handling display of Pickup Codes in admin listing for Trans Depts. Now departments with greater than 201 pick up codes show a number indicating how many are mapped to the department rather than listing them all in the admin table listing.
- Adding --reset switch for
wp cli fixzips - Checking for
DONMAN_DEV_ENVwhen sending Transportation Department notification. This allows for easy localhost testing. If "Development Environment", then we are sending the notification email even if the provider receives donations via their API.
4.4.4.6
- BUGFIX: Setting
permission_callbackfor zip code search to__return_true.
4.4.4.5
- BUGFIX: Setting correct relative path in
donation-reports.phpto allow for downloading of "Combined Reports".
4.4.4.4
- BUGFIX: Updating
$provide_additional_detailsto support ACF Field definition fortrue/falsefield inlib/fns/shortcode/donationform/screening-questions.php.
4.4.4.3
- BUGFIX: Updating
site_url()tohome_url()in instances where we're building URL refs from the site's Home URL.
4.4.4.2
- Updating copyright year in email footers.
4.4.4.1
- BUGFIX: Additional image path corrections in email templates.
4.4.4
- BUGFIX: Correcting image paths in email templates.
4.4.3
- BUGFIX: Hard-coding
from:support@pickupmydonation.comfor Sender Authentication in New Account Email.
4.4.2
- BUGFIX: Checking for array and array key before checking variable.
4.4.1
- BUGFIX: Checking if variable is an array before running
array_key_exists()in/lib/fns/callback/05.validate-contact-details.php.
4.4.0
- Adding
org,org-inactive, andrejecteduser roles. - Login/logout redirects for
orgusers.
4.3.1
- Adding
[get_additional_options_form]for loading Additional Organization Options form in the User Portal.
4.3.0
- Adding User Portal.
4.2.4
- Hiding "Preferred Contact Method" field from donor form, setting Preferred Contact Method to always be "Phone".
4.2.3
- Updating for Composer install compatiblity.
4.2.2
- Minor edit to "Fee-Based Pickup Service" note on "Select Your Organization" view.
4.2.1
- Updating "No Damaged Items Message" by adding
{store_signature}as an available token and documenting available tokens for the ACF field.
4.2.0
- Updating
[donors_in_your_area]to pull KML from https://zipcodes.pickupmydonation.com. - Deactivating "Click to Claim".
4.1.0
- Removing "Fee-Based/Priority" option from the "Select Your Organization" screen.
4.0.0
- Updating "Fee-Based" option to utilize generic verbiage during the "Select Your Organization" step.
3.9.4
- Adding "Prices start as low as..." call out to Fee-Based note on Step 4.
3.9.3
- Adding "PriorityPickup" column to CSV export in "My Donations > Donation Reports > Combined Donations" report.
3.9.2
- Adding "Fails" column to "College Hunks API Stats" widget.
- Adding "Note" to the bottom of the "College Hunks API Stats" widget explaining "Fails".
3.9.1.1
- BUGFIX: Setting required constants to
nullwhen not set to avoid fatal error upon setup.
3.9.1
- Updating output for
wp dm archiveto correctly show the$donation_statsthat would be written to the database. - Correcting examples in documentation for
wp dm archive.
3.9.0
- Adding "Fee-Based" option on Step 4 allowing donors to choose whether or not we send their donation to fee-based providers.
3.8.0.1
- BUGFIX: Accounting for "Pick Up Days of the Week" values stored as "strings" from PMD 2.0 Org imports. Now we set the available pick up days to the default (Mon-Sat) when this happens.
3.8.0
- Now orphaned donations are sent to priority partners using the Email delivery method. Previously, orhpans would only get sent using the API method which meant that only College Hunks would receive orphaned donations.
3.7.5
- Using
usort()to sort Pick Up Times returned byget_pickuptimes().
3.7.4
- Adding "Store Relations" and "Org Page Options" to
lib/acf-json/. - Correctly retrieving values for Pick Up Days of the Week and Min. Scheduling Interval.
- Updating holiday/restricted pick up dates for the Step 4 screen.
3.7.3
- Adding option to use the Transportation Department's name when displaying to users in the "Select Your Organization" list. This allows us to use one parent Organization for multiple Transportation Departments.
send_email()now always returns before sending thetrans_dept_notificationif therouting_methodis notemail.- Setting defaults for Transportation Contact details in the
donor_confirmationemail. - Removing dependency on
get_submit_button()WP helper function as this function can only be used in an admin context ( see get_submit_button user contributed notes). Was throwing an error when calling via the WP REST API.
3.7.2.2
- BUGFIX: Correcting variable name to
$is_chhj_pickupcodeinsend_api_post().
3.7.2.1
- Adding
wp dm testforis_valid_pickupcode().
3.7.2
- Updatin
send_api_post()to only post to an external API if the pickup code is valid for the organization. - Adding
is_valid_pickupcode()for determining if a pickup code is valid given a search string to compare against the returned organizations for the pickup code. - Updating "API Response" column to list available organizations for a given pickup code when no
api_postmeta field value exists.
3.7.1
- Adding
ksort()to stats displayed bychhj_stats_dashboard_widget(). - Adding "Success Rate" column to
chhj_stats_dashboard_widget().
3.7.0.3
- BUGFIX: Adjusting switch statement in
lib/fns/apirouting.phpto route donations to the CHHJ API when$routing_methodis also equal tochhj_api. This is in addition to acceptingapi-chhj. This fixes the issue where although thetrans_dept_notificationswitch inlib/fns/emails.phpwas callingsend_api_post()ifif( 'email' != $donor['routing_method'] ), the actualsend_api_post()function did not have a switch statement to handle the PMD 3.0$routing_methodvalue ofchhj_apias defined in the ACF Field under each organization's "Pickup Settings".
3.7.0.2
- Allowing HTML in "Customer Description" field inside
email.donation-receipt.hbs.
3.7.0.1
- Accepting
api-chhjin addition tochhj_apias valid matching conditions for "Routing Method" column for Organization admin listing.
3.7.0
- Adding "Routing Method" column to Organization admin listing.
3.6.6
- Adding "College Hunks API Stats" dashboard widget.
3.6.5.4
- Updating "Click to Claim" link text in compiled file.
3.6.5.3
- Updating link in "Click To Claim" emails from "Click To Claim This Donation" to "View This Donation".
3.6.5.2
- BUGFIX: Correctly spliting multiple organization emails when sending monthly reports.
3.6.5.1
- Adding post_type=page as additional display param for City Pages ACF Field Group.
3.6.5
- Updating User Photo Uploads to include an ACF Option for making them required. Now, by default, User Photo Uploads are "optional".
- Removed
get_socialshare_copy()as it is no longer in use.
3.6.4.3
- Better response code handling for API Response column in Donation CPT admin listings.
3.6.4.2
- Adding
custom_column_api_response_content()to handle display of HTML in the API Response column in admin Donation CPT listings.
3.6.4.1
- Saving API response code and message as separate fields.
- Better handling of API response data.
3.6.4
- Restoring "Skip Pick Up Dates" functionality.
3.6.3.3
- BUGFIXES: Checking for variables before using in code.
- Adding option to turn on Debug Mode with Verbose set to ON.
3.6.3.2
- Checking for variables existence.
3.6.3.1
- BUGFIX: Checking if variable is_array() before running array_key_exists() in
04.validate-screening-questions.php. - Checking if array key exists in
describe-your-donation.php.
3.6.3
- Introducing
DMDEBUG_VERBOSEconstant for "verbose mode" debugging. - Moved several
uber_log()called into "verbose mode" during the[donationform]process.
3.6.2.1
- Bugfix: Addressing correct namespace in
[unsubscribe-orphaned-contact]shortcode.
3.6.2
- Updating
wp dm fixzipsto work with new PMD 3.0 data structures.
3.6.1.1
- Updating admin column width for Pickup Codes on Transportation Department CPT listing.
3.6.1
- Updating CHHJ API Response to show plaintext errors stored in
api_responsemeta field.
3.6.0
- API Response monitoring via new "API Response" column in the Donation CPT admin listing.
3.5.1.1
- Removing call to
print_r()before saving CHHJ API Response.
3.5.1
- Saving CHHJ API Response as serialized array.
- Adding admin CSS for Donation listing and API Response column.
3.5.0
- Updating
wp dm report --type=organizationsto correctly pull data from donations. - Updating
wp dm reportto work without needing to enter a YYYY-MM.
3.4.2.2
- BUGFIX: Removing orphaned donation note from Exclusive Partners emails.
3.4.2.1
- BUGFIX: Checking if
$contactsis null before usingcount()inget_priority_organizations(). - Including note in Trans Dept notifications in markets without any contacts.
3.4.2
- Listing orphaned donation notifications in the Donations admin post listing.
3.4.1
- Updating email address in Transportation Department note for Orphaned Donation emails.
- Removing social sharing note from Donor Confirmation email.
3.4.0
- New Feature:
[click_to_claim]shortcode for processing "Click to Claim" links. - Removing "social sharing" note on donation receipt.
- Adding
get_contact()for retrieving contact details of Network Providers.
3.3.9.7
- BUGFIX: Using
DONMAN_DEV_ENVinstead ofWP_DEBUGto accomodate SpinupWP default settings in production.
3.3.9.6
- BUGFIX: PHP 8 compatiblity: Removing optional parameter appearing before required parameter in
DonationRouter::save_api_response(). - Adding WP CLI test for
get_donation_routing_method().
3.3.9.5
- BUGFIX: Fixing
get_donations_by_area()so that the zip code for a donation is returned to be used in grabbing the coordinates for a donation. - Adding
get_donation_zip_code()for retrieving a donation's zip code given a Donation ID.
3.3.9.4
- BUGFIX: Updating
custom_save_post()to handle integer (i.e. Org ID) returned fromorganizationfield.
3.3.9.3
- Correctly calling
CHHJDonationRouterfrom the parent namespace insidesend_api_post(). - Checking for
$_SESSION['donor']insend_email()before setting variables.
3.3.9.2
- Setting
publicly_queryableandshow_in_resttofalsefor Donations CPT. - Setting
exclude_from_searchtotruefor Donations CPT.
3.3.9.1
- BUGFIX: Adding PMD 2.0 images.
3.3.9
- Styling/Layout for
[donors_in_your_area/]. - Correcting namespace function calls in
api.rest.phpfor use with[donors_in_your_area/]. - Adding
statattribute to[donation-stats]for calling "donations-last-month" and "donations-last-month-value".
3.3.8
- Adding
orphaned_donation_exists().
3.3.7.2
- BUGFIX: Refactoring screening questions to work with Taxonomy Order plugin.
3.3.7.1
- BUGFIX: Checking if variable isset() inside
get_screening_questions()rather than true/false.
3.3.7
- Setting
DMDEBUGconstant. - DEBUG output for donor emails in
send_email().
3.3.6
- BUGFIX: Manually setting ACF Display Rules for City Page Options to include the Page ID for "City Pages" on the production server. By doing this, any time we update the plugin on production, the City Page Options should be properly displayed for child pages of the "City Pages" page.
- BUGFIX: Checking for object before attempting to retrieve object property in
custom_save_post().
3.3.5
- BUGFIX: Converting variable assigments to work with ACF true/false fields when working with Organization Pickup Settings.
3.3.4
- BUGFIX: Checking for array in
get_realtor_ads().
3.3.3
- BUGFIX: Moving
$templatevariable assigment insidelib/fns/shortcode/donationform/default.phpto allow all other steps to properly set their own form templates.
3.3.2
- Setting default initial donation form for
[donationform/]. - Showing available
template=""options for initial[donationform/]option.
3.3.1
- Adding
sort_columnoption to[list_pages/]. - Updating
list_pages()to useget_posts()instead ofget_pages().
3.3.0
- Adding "Alternate Title" to City Page options.
- Adding
[list_pages/]shortcode for listing the children of a page.
3.2.1
- BUGFIX: Checking for numeric value before attempting
+=operation inget_archived_donations().
3.2.0
- Adding City Pages sidebar shortcode (i.e.
[city_page_sidebar/]). - Adding City Pages realtor description shortcode (i.e.
[city_page_realtor_description/]). - Adding
[donationform template="form0.city-page" /]template for City Page. - Adding "template" attribute for
[donationform/]shortcode.
3.1.0
- Adding City Pages ACF fields.
3.0.2
- Updating
lib/fns/admin.php::custom_save_post()to properly obtain the$org_id.
3.0.1
- Adding
pickup_codetaxonomy tolib/cpt/. - Adding Github URL to README.
3.0.0
- Complete rewrite of PMD 2.0.
- Setting up CPTs and Taxonomies inside
lib/cpt/. - Storing ACF definitions in
lib/acf-json/. - Dismissable admin notifications.