From one perspective, Seamless Donations 4.0.6 is just a maintenance release. No (or at least very few) new features are added and much of the time has been spent fixing a few nasty bugs. But from another perspective — in terms of how much improvement has been made in the internal architecture — SD4.0.6 is a pretty significant update.
I discussed Reengineering the Seamless Donations core payment gateway in my last Lab Note, so there’s no need to rehash what was done there, save to point out that some very unstable aspects of the way Seamless Donations has always handled PayPal payments has been rebuilt. This does not get us all the way to being able to add payment gateways, but it certainly removes some of the instability and difficult-to-integrate code that has been standing in the way.
Another subsystem that has been updated considerably is the main seamless-donations shortcode. Rather than hard-coding new shortcode parameters, SD4.0.6 allows parameters to be added in a highly extensible manner. I’ll discuss that in the “For techies” section below.
A new “Debug Mode” option has been added to the Settings tab, but it’s really a placeholder now, to allow for debug support capabilities later. Finally, a “Add label tag to input form (may improve form layout for some themes)” tweak has been added to the Form options tag. If you check it, it will generate an HTML LABEL tag before the text input fields, which may improve some display compatibility issues.
For techies
As mentioned above, the base seamless-donations shortcode is now programmatically extensible. An array of callbacks initiated in the shortcode, but add-on software can add to or modify that array. This is accomplished with the filter seamless_donations_shortcode_features. Once the filter has been called, the shortcode hub goes through each entry in the array and calls the WordPress add_filter function. It then goes through each entry in the array and calls apply_filter to each filter, passing each filter the list of attributes. Each filter can then choose to return a result or an empty string. Finally, the result of the shortcode heirarchy walk is output to the screen.
The payments system also gets a new hook, seamless_donations_payment_post_data. This takes the full array of data about to be sent to PayPal and allows a programmer to tinker with it.
Finally, as for the Debug Mode option described above, that checkbox sets a dgx_donate_debug_mode option. Do a get_option(‘dgx_donate_debug_mode’) and compare against 1 to determine if in debug mode. 1 means debug mode is on, and 0 means it’s not. Don’t leave debug mode on because it could reduce security and it will display an annoying banner until yhou turn it back off.