updated plugin Easy Digital Downloads
version 3.1.1.3
This commit is contained in:
@ -846,30 +846,8 @@ abstract class Table extends Base {
|
||||
*/
|
||||
private function get_db_version() {
|
||||
$this->db_version = $this->is_global()
|
||||
? get_network_option( get_main_network_id(), $this->db_version_key, false )
|
||||
: get_option( $this->db_version_key, false );
|
||||
|
||||
/**
|
||||
* If the DB version is higher than the stated version and is 12 digits
|
||||
* long, we need to update it to our new, shorter format of 9 digits.
|
||||
*
|
||||
* This is only for 3.0 beta testers, and can be removed in 3.0.1 or above.
|
||||
*
|
||||
* @link https://github.com/easydigitaldownloads/easy-digital-downloads/issues/7579
|
||||
*/
|
||||
if ( version_compare( $this->db_version, $this->version, '<=' ) || ( 12 !== strlen( $this->db_version ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Parse the new version number from the existing. Converting from
|
||||
// {YYYY}{mm}{dd}{xxxx} to {YYYY}{mm}{dd}{x}
|
||||
$date = substr( $this->db_version, 0, 8 );
|
||||
$increment = substr( $this->db_version, 8, 4 );
|
||||
|
||||
// Trims off the three prefixed zeros.
|
||||
$this->db_version = intval( $date . intval( $increment ) );
|
||||
|
||||
$this->set_db_version( $this->db_version );
|
||||
? get_network_option( get_main_network_id(), $this->db_version_key, 1 )
|
||||
: get_option( $this->db_version_key, 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,7 +38,7 @@ final class Customers extends Table {
|
||||
* @since 3.0
|
||||
* @var int
|
||||
*/
|
||||
protected $version = 202301021;
|
||||
protected $version = 202303220;
|
||||
|
||||
/**
|
||||
* Array of upgrade versions and methods
|
||||
@ -48,9 +48,9 @@ final class Customers extends Table {
|
||||
* @var array
|
||||
*/
|
||||
protected $upgrades = array(
|
||||
'202002141' => 202002141,
|
||||
'202006101' => 202006101,
|
||||
'202301021' => 202301021,
|
||||
'202303220' => 202303220,
|
||||
);
|
||||
|
||||
/**
|
||||
@ -248,4 +248,18 @@ final class Customers extends Table {
|
||||
|
||||
return $this->is_success( $return_result );
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrades the customer database for sites which got into a bit of a snarl with the database versions.
|
||||
*
|
||||
* @since 3.1.1.3
|
||||
* @return bool
|
||||
*/
|
||||
protected function __202303220() {
|
||||
if ( $this->needs_initial_upgrade() ) {
|
||||
return $this->__202301021();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user