updated plugin Easy Digital Downloads version 3.1.1.2

This commit is contained in:
2023-03-17 22:34:04 +00:00
committed by Gitium
parent e8a66564bd
commit 19e086d1c4
647 changed files with 20986 additions and 27305 deletions

View File

@ -20,36 +20,19 @@ defined( 'ABSPATH' ) || exit;
*/
function edd_do_automatic_upgrades() {
$did_upgrade = false;
$edd_version = edd_get_db_version();
if ( version_compare( $edd_version, EDD_VERSION, '<' ) ) {
// Let us know that an upgrade has happened
$did_upgrade = true;
if ( version_compare( $edd_version, EDD_VERSION, '>=' ) ) {
return;
}
if ( $did_upgrade ) {
edd_update_db_version();
// Send a check in. Note: this only sends if data tracking has been enabled
$tracking = new EDD_Tracking;
$tracking->send_checkin( false, true );
}
// 2.9.2 to 2.9.3
$fix_show_privacy_policy_setting = edd_get_option( 'show_agree_to_privacy_policy_on_checkout', false );
if ( ! empty( $fix_show_privacy_policy_setting ) ) {
edd_update_option( 'show_privacy_policy_on_checkout', $fix_show_privacy_policy_setting );
edd_delete_option( 'show_agree_to_privacy_policy_on_checkout' );
}
// 3.0: deactivate Manual Purchases addon
if ( function_exists( 'edd_load_manual_purchases' ) ) {
deactivate_plugins( 'edd-manual-purchases/edd-manual-purchases.php' );
delete_option( 'edd_manual_purchases_license_active' );
// Existing stores should set the upgraded version and the onboarding wizard as complete.
if ( ! empty( $edd_version ) ) {
update_option( 'edd_version_upgraded_from', $edd_version, false );
if ( ! get_option( 'edd_onboarding_completed', false ) && ! get_option( 'edd_onboarding_started', false ) ) {
update_option( 'edd_onboarding_completed', true, false );
}
}
edd_update_db_version();
}
add_action( 'admin_init', 'edd_do_automatic_upgrades' );
@ -132,11 +115,8 @@ function edd_show_upgrade_notices() {
// Include all 'Stepped' upgrade process notices in this else statement,
// to avoid having a pending, and new upgrade suggested at the same time
if ( get_option( 'edd_upgrade_sequential' ) && edd_get_payments( array( 'fields' => 'ids' ) ) ) {
printf(
'<div class="notice notice-warning"><p>' . __( 'Easy Digital Downloads needs to upgrade past orders to make them sequential. <a href="%s">Start the order numbers upgrade</a>.', 'easy-digital-downloads' ) . '</p></div>',
esc_url( admin_url( 'index.php?page=edd-upgrades&edd-upgrade=upgrade_sequential_payment_numbers' ) )
);
if ( get_option( 'edd_upgrade_sequential' ) ) {
delete_option( 'edd_upgrade_sequential' );
}
if ( version_compare( $edd_version, '2.1', '<' ) ) {
@ -388,8 +368,6 @@ function edd_trigger_upgrades() {
edd_v20_upgrades();
}
edd_update_db_version();
// Let AJAX know that the upgrade is complete
if ( edd_doing_ajax() ) {
die( 'complete' );
@ -660,6 +638,7 @@ function edd_v20_upgrades() {
/**
* Upgrades for EDD v2.0 and sequential payment numbers
*
* @deprecated 3.1.1.2 EDD no longer implies that past orders will be updated.
* @since 2.0
* @return void
*/
@ -725,7 +704,6 @@ function edd_v20_upgrade_sequential_payment_numbers() {
edd_redirect( admin_url() );
}
}
add_action( 'edd_upgrade_sequential_payment_numbers', 'edd_v20_upgrade_sequential_payment_numbers' );
/**
* Upgrades for EDD v2.1 and the new customers database
@ -817,7 +795,6 @@ function edd_v21_upgrade_customers_db() {
// No more customers found, finish up
} else {
edd_update_db_version();
delete_option( 'edd_doing_upgrade' );
edd_redirect( admin_url() );
@ -854,7 +831,6 @@ function edd_v226_upgrade_payments_price_logs_db() {
$has_variable = $wpdb->get_col( $sql );
if ( empty( $has_variable ) ) {
// We had no variable priced products, so go ahead and just complete
edd_update_db_version();
delete_option( 'edd_doing_upgrade' );
edd_redirect( admin_url() );
}
@ -931,7 +907,6 @@ function edd_v226_upgrade_payments_price_logs_db() {
edd_redirect( $redirect );
} else {
edd_update_db_version();
delete_option( 'edd_doing_upgrade' );
edd_redirect( admin_url() );
}
@ -968,7 +943,6 @@ function edd_v23_upgrade_payment_taxes() {
if ( empty( $has_payments ) ) {
// We had no payments, just complete
edd_update_db_version();
edd_set_upgrade_complete( 'upgrade_payment_taxes' );
delete_option( 'edd_doing_upgrade' );
edd_redirect( admin_url() );
@ -1007,7 +981,6 @@ function edd_v23_upgrade_payment_taxes() {
// No more payments found, finish up
} else {
edd_update_db_version();
edd_set_upgrade_complete( 'upgrade_payment_taxes' );
delete_option( 'edd_doing_upgrade' );
edd_redirect( admin_url() );
@ -1045,7 +1018,6 @@ function edd_v23_upgrade_customer_purchases() {
if ( empty( $has_payments ) ) {
// We had no payments, just complete
edd_update_db_version();
edd_set_upgrade_complete( 'upgrade_customer_payments_association' );
delete_option( 'edd_doing_upgrade' );
edd_redirect( admin_url() );
@ -1126,7 +1098,6 @@ function edd_v23_upgrade_customer_purchases() {
// No more customers found, finish up
} else {
edd_update_db_version();
edd_set_upgrade_complete( 'upgrade_customer_payments_association' );
delete_option( 'edd_doing_upgrade' );
@ -1165,7 +1136,6 @@ function edd_upgrade_user_api_keys() {
// We had no key, just complete
if ( empty( $has_key ) ) {
edd_update_db_version();
edd_set_upgrade_complete( 'upgrade_user_api_keys' );
delete_option( 'edd_doing_upgrade' );
edd_redirect( admin_url() );
@ -1209,7 +1179,6 @@ function edd_upgrade_user_api_keys() {
// No more customers found, finish up
} else {
edd_update_db_version();
edd_set_upgrade_complete( 'upgrade_user_api_keys' );
delete_option( 'edd_doing_upgrade' );
edd_redirect( admin_url() );
@ -1271,7 +1240,6 @@ function edd_remove_refunded_sale_logs() {
// No more refunded payments found, finish up
} else {
edd_update_db_version();
edd_set_upgrade_complete( 'remove_refunded_sale_logs' );
delete_option( 'edd_doing_upgrade' );
edd_redirect( admin_url() );