Skip to content

Commit

Permalink
Add upgrade script for fixing broken payflow deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
dparker1005 committed Feb 18, 2025
1 parent c548eb6 commit 02ff072
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions includes/upgradecheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,32 @@ function pmpro_checkForUpgrades() {
pmpro_db_delta();
update_option( 'pmpro_db_version', '3.4' );
}

/**
* Version 3.4.3
* Fixing broken Payflow deprecation.
*/
if ( $pmpro_db_version < 3.403 ) {
// Check if there are any Payflow settings.
if ( ! empty( get_option( 'pmpro_payflow_partner' ) ) ) {
// Get the current list of undeprecated gateways.
$undeprecated_gateways = get_option( 'pmpro_undeprecated_gateways' );
if ( empty( $undeprecated_gateways ) ) {
$undeprecated_gateways = array();
} elseif ( is_string( $undeprecated_gateways ) ) {
// pmpro_setOption turns this into a comma separated string
$undeprecated_gateways = explode( ',', $undeprecated_gateways );
}

// If Payflow isn't in the list, add it.
if ( ! in_array( 'payflowpro', $undeprecated_gateways ) ) {
$undeprecated_gateways[] = 'payflowpro';
update_option( 'pmpro_undeprecated_gateways', $undeprecated_gateways );
}
}

update_option( 'pmpro_db_version', '3.403' );
}
}

function pmpro_db_delta() {
Expand Down

0 comments on commit 02ff072

Please sign in to comment.