updated plugin Easy Digital Downloads version 3.1.1.4.2

This commit is contained in:
2023-06-05 11:21:17 +00:00
committed by Gitium
parent e5482aabb7
commit b7bbe6d733
105 changed files with 3161 additions and 1326 deletions

View File

@ -144,10 +144,6 @@ function edd_complete_purchase( $order_id, $new_status, $old_status ) {
delete_transient( md5( 'edd_earnings_todaytoday' ) );
}
// Increase the customer's purchase stats
$customer = new EDD_Customer( $customer_id );
$customer->recalculate_stats();
edd_increase_total_earnings( $amount );
// Check for discount codes and increment their use counts
@ -174,7 +170,8 @@ function edd_complete_purchase( $order_id, $new_status, $old_status ) {
) );
// Required for backwards compatibility.
$payment = edd_get_payment( $order_id );
$payment = edd_get_payment( $order_id );
$customer = edd_get_customer( $customer_id );
/**
* Runs **when** a purchase is marked as "complete".

View File

@ -989,9 +989,6 @@ class EDD_Payment {
do_action( 'edd_payment_saved', $this->ID, $this );
}
$customer = new EDD_Customer( $this->customer_id );
$customer->recalculate_stats();
/**
* Update the payment in the object cache
*/
@ -2655,15 +2652,6 @@ class EDD_Payment {
if ( true === $alter_store_earnings ) {
edd_decrease_total_earnings( $this->total );
}
// Decrement the stats for the customer
if ( ! empty( $this->customer_id ) ) {
$customer = new EDD_Customer( $this->customer_id );
if ( ! empty( $alter_customer_value || $alter_customer_purchase_count ) ) {
$customer->recalculate_stats();
}
}
}
/**

View File

@ -215,10 +215,6 @@ function edd_delete_purchase( $payment_id = 0, $update_customer = true, $delete_
}
}
if ( $customer && $customer->id && $update_customer ) {
$customer->recalculate_stats();
}
do_action( 'edd_payment_deleted', $payment_id );
}