I’m writing a WordPress plugin for a small educational nonprofit in Africa (PAAJAF.org) that allows users to create a fundraising campaign leveraging the GiveWP donation plugin. I started out several years ago leveraging the Seamless Donations plugin, but the charity wanted more functionality than Seamless Donations provided at that time. While my plugin is still in final stages of testing, if interested, contact me. Eventually this plugin may find its way into the plugin repository on WordPress.org, but for now I don’t want to deal with the overhead (i.e., using SVN) of a released plugin unless there is clear interest from other nonprofits. While I have coded the plugin to WordPress coding standards, made its code GPL, and done most of the work for translation to other languages, it remains a project for the PAAJAF non-profit and PAAJAF requirements are guiding development.
I also feel compelled to mention that using this plugin really goes against general advice on selecting plugins. A great many plugins are developed by an individual (or a few people) and over time and for various reasons, stop being updated as WordPress (and PHP) evolve. While I have maintained this plugin (and its Seamless Donations-based predecessor) for several years and plan to do so indefinitely, I could be hit by the preverbal bus at any time and no longer be able to maintain it. PAAJAF is taking this risk to get a custom-developed plugin meeting their exact requirements. When picking a plugin, it is important to evaluate its ecosystem to determine that it will likely be maintained or extended over the next few years. More on these considerations in Selecting a Plugin.
My WordPress-related contribution to the PAAJAF.org charity is developing a plugin that provides the functionality for personal fundraising campaigns. A campaign is a fundraising activity created by a WordPress user to support a specific nonprofit project or program and is then promoted by that WordPress user (also known as the fundraiser). The Campaign allows donations to be tracked. The actual donation handling is done by the Give plugin and its payment gateways.
To start, a Give Donation form is created for each project or program by the administrator. The administrator can customize the donation form as provided by the Give plugin, such as with various donation amounts, display styles, and form fields. The personal-fundraiser plugin allows the fundraiser to substitute only a few of the form customization options–the title, the message, the featured image, the goal, and, if the count-down extension is installed, the ending date–on the donation form created for their Campaign.
The general operational flow for creating a new Campaign is a three-step process:
- a WordPress user (i.e., the fundraiser) fills out a form requesting a new Campaign identifying the program/project’s Give form and any of the desired substitutions,
- the form plugin generates a notification email to an approval email address, and
- if the request is approved after review, personal-fundraiser plugin creates a new Give form with the indicated substitutions, and the fundraiser is notified of the Campaign going live.
When the new Campaign email is received by the fundraiser, they can promote the Campaign to their friends or on their social networks or by any other means they choose. The email contains a link to the Campaign’s Give Form. The fundraiser will receive updates on their Campaign such as when 50% or 90% or 100% of the goal is achieved or when the Campaign is about to end.
Since it was already used for other purposes on PAAJAF.org, the Visual Form Builder plugin is used to create the Campaign request form, and the Notification plugin is used to notify the fundraiser. Unfortunately, different forms or notification plugins cannot be used without code changes to the personal-fundraiser plugin.
The personal-fundraiser plugin is designed to work in conjunction with a Give plugin version 2.6.3 or newer and its form-countdown-for-givewp extension. The plugin displays a warning message on the admin dashboard if the Give plugin is no longer active or has been updated to an unverified version. It is important to verify any new Give plugin version since changes to the Give plugin, even in a patch release, may be incompatible because the personal-fundraiser plugin uses some API’s internal to the Give plugin. The release numbers only apply to defined public API’s and not the undocumented internal APIs the personal-fundraiser plugin must use for some functionality. Instructions for verifying new Give versions are contained in the top-level personal-fundraiser.php file.
While the personal-fundraiser plugin should work with any recent version of WordPress or PHP, it has been tested with WordPress 5.5 and PHP 7.4.2. And since this is custom development for PAAJAF, the plugin is tested using the environment provided by PAAJAF’s hosting service.
To reduce the support and maintenance demands, the Personal-Fundraiser plugin relies on the Visual Forms Builder plugin and the Notification plugin.
Localizing to Another Language
The personal-fundraiser plugin was developed in English, but includes the code necessary for localization to other languages. Whenever a string is displayed to the user, it is first run through one of the WordPress standard translation functions, such as
__(). The translation domain of the plugin is ‘personal-fundraiser’. Internally, strings, such as those used for array keys, are in English. While the plugin was developed to be localized to another language, such localization has NOT been tested and so must be tested after the first translation to make sure there are no translation omissions or problems.