[buddypress-trac] [BuddyPress Trac] #8003: Setting Reply-To and From causes excessive database overhead in cases where addresses don't match a user
buddypress-trac
noreply at wordpress.org
Sun Nov 25 20:30:02 UTC 2018
#8003: Setting Reply-To and From causes excessive database overhead in cases where
addresses don't match a user
------------------------------------+----------------------
Reporter: boonebgorges | Owner: DJPaul
Type: enhancement | Status: new
Priority: normal | Milestone: Up Next
Component: Emails | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+----------------------
Changes (by boonebgorges):
* milestone: Under Consideration => Up Next
Comment:
Thanks for the quick feedback, @DJPaul.
IMO, no rush to sneak a quick fix into 4.0. If I'm the first person to see
this issue in the wild, then it won't hurt to let it slide for another
release.
I've attached a quick patch that adds the following:
- An interface `BP_Email_Address`, which describes classes with
`get_name()`, `get_address()`, and their corresponding `setters()`
- An abstract base class `BP_Email_Person` that implements
`BP_Email_Address` and has some default logic (and filters) for these
methods
- A new `BP_Email_Sender` that extends (without modifying)
`BP_Email_Person`. This class is then used for setting up the Reply-To and
From fields in `BP_Email`
- `BP_Email_Recipient` now extends `BP_Email_Person`. This took just a few
small changes. I've converted the `get_address()` etc methods to wrappers
for the parent methods, in order to maintain backward compatibility with
the `_recipient_` filters.
All this (especially the interface) might be a little overarchitected
given that BP doesn't currently use type-hinting or dependency injection
or other OOP techniques that would necessitate an actual interface. But it
does give us a framework for introducing that kind of stuff into the
`BP_Email` stack in the future. Alternatively, we could scrap the
interface, and just have an abstract base class.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8003#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list