PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.0.1 4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 All 258 releases
← All changes | includes/admin/emails/class-new-offline-donation-email.php +7 -5 4.16.6 → 4.18.0 View file →
@@ -245,8 +245,9 @@
245 245
246 246 /**
247 247 * Setup email notification.
248 248 *
249 + * @since 4.18.0 Check the gateway from meta before loading the legacy payment object.
249 250 * @since 2.0
250 251 * @access public
251 252 *
252 253 * @param int $payment_id
@@ -251,8 +252,14 @@
251 252 *
252 253 * @param int $payment_id
253 254 */
254 255 public function setup_email_notification( $payment_id ) {
256 + // Exit if not donation was not with offline donation. Checked from meta first so every
257 + // non-offline donation does not pay for building a Give_Payment on insert.
258 + if ( 'offline' !== give_get_payment_gateway( $payment_id ) ) {
259 + return;
260 + }
261 +
255 262 $this->payment = new Give_Payment( $payment_id );
256 263
257 264 if ( ! $this->payment->ID ) {
258 265 wp_die(
@@ -261,13 +268,8 @@
261 268 array(
262 269 'response' => 400,
263 270 )
264 271 );
265 - }
266 -
267 - // Exit if not donation was not with offline donation.
268 - if ( 'offline' !== $this->payment->gateway ) {
269 - return;
270 272 }
271 273
272 274 // Set email data.
273 275 $this->setup_email_data();