Give 2.3.0 adds two new custom tables:
Upon updating to 2.3.0, users will be asked to complete a backwards-compatible database migration that moves the following data types to the new custom comment tables:
- Donation Notes (as seen in the Donation details screen in WP Admin)
- Donor Notes (as seen in the Donor details screen in WP Admin)
- Donor Comments (as seen in the donor walls of donation forms that have comments enabled)
Rationale for Change
Whenever possible, we try to leverage existing WordPress data structures in an effort to establish long-term compatibility with WordPress.
In previous versions of Give, it seemed appropriate to leverage WordPress comments for data types like donation notes, donor notes, and donor comments. After all, these data types have a lot in common with WordPress comments, and the
wp_comments table appeared to be a natural location to store this type of data.
However, we recently became aware of some problems related to mixing WordPress post comments with custom data types like those used by Give.
- Mixing WordPress post comments with custom comments was throwing off comment counts used throughout WordPress Admin. This is a known issue with many plugins that leverage the
wp_commentstable. Typically these comment counts are filtered, however we observed that filters from multiple plugins can also override each other.
comment_parentcolumn in the
wp_commentstable is only intended to store the ID of another comment, whereas Give was trying to store the ID of a donation post. This issue became obvious when we received reports of the Donor Wall appearing without comments.
- After GDPR took effect, we began receiving reports that the notes and comments created by Give were triggering false positives for GDPR-related plugins aimed at preventing comment spam.
As these conflicts piled up, it became obvious that we needed a more stable, long-term solution for comment-like data in Give. As a result, the two new custom tables were added and a backwards-compatible migration was developed.
Full details behind the motivation and implementation of these changes can be found in the GitHub issue.
For clarity, the previous and current storage locations for the affected data types are described below.
Database Location Before Give 2.3.0
- Donor Notes – Each donor note was being stored as a new line in the
notescolumn of the
- Donation Notes – Each donation note was being stored in a new row in the
- Donor Comments – Each donor comment was being stored in a new row in the
Database Location After Give 2.3.0
- Donor Notes – Each donor note is stored in a new row in the
- Donation Notes – Each donation note is stored in a new row in the
- Donor Comments – Each donor comment is stored in a new row in the
The changes regarding Give comment storage do not have any user-facing effects other than an admin notice for the database migration. While this is a relatively seamless change from the user’s perspective, these custom tables introduce a new level of stability, control, and performance optimization that will benefit Give developers and users well into the future.