Skip to content

Commit

Permalink
Merge pull request #9640 from awesomemotive/release/3.1.1.3
Browse files Browse the repository at this point in the history
Copying over 3.1.1.3
  • Loading branch information
cklosowski authored Apr 21, 2023
2 parents 252c8d7 + 2c452c9 commit 8f2c130
Show file tree
Hide file tree
Showing 16 changed files with 175 additions and 136 deletions.
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions easy-digital-downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Description: The easiest way to sell digital products with WordPress.
* Author: Easy Digital Downloads
* Author URI: https://easydigitaldownloads.com
* Version: 3.1.1.2
* Version: 3.1.1.3
* Text Domain: easy-digital-downloads
* Domain Path: languages
* Domain Path: /languages
* Requires at least: 5.4
* Requires PHP: 7.1
*
Expand All @@ -27,7 +27,7 @@
* @package EDD
* @category Core
* @author Easy Digital Downloads
* @version 3.1.1.2
* @version 3.1.1.3
*/

// Exit if accessed directly.
Expand Down
6 changes: 6 additions & 0 deletions includes/admin/payments/class-payments-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,12 @@ private function parse_args( $paginate = true ) {
'type' => $type,
) );

// If no specific ordering has been requested, order by `date_created`.
if ( empty( $_GET['orderby'] ) ) {
$args['orderby'] = 'date_created';
$args['order'] = 'DESC';
}

// Update args by search query.
if ( ! empty( $search ) ) {
$args = $this->parse_search( $search, $args );
Expand Down
2 changes: 1 addition & 1 deletion includes/class-easy-digital-downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ private function setup_constants() {

// Plugin version.
if ( ! defined( 'EDD_VERSION' ) ) {
define( 'EDD_VERSION', '3.1.1.2' );
define( 'EDD_VERSION', '3.1.1.3' );
}

// Make sure CAL_GREGORIAN is defined.
Expand Down
7 changes: 4 additions & 3 deletions includes/class-edd-requirements-check.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ public function __construct() {
$this->file = EDD_PLUGIN_FILE;
$this->base = EDD_PLUGIN_BASE;

// Always load translations
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );

// Load or quit
$this->met()
? $this->load()
Expand Down Expand Up @@ -416,6 +413,9 @@ public function met() {
/**
* Plugin specific text-domain loader.
*
* @deprecated 3.1.1.3. Since EDD no longer bundles any language files,
* and WordPress Core automatically loads the custom wp-content/languages/easy-digital-downloads/.mo file if it's found,
* this is no longer needed.
* @since 1.4
* @return void
*/
Expand Down Expand Up @@ -492,6 +492,7 @@ public function load_textdomain() {
/**
* Load a .mo file for the old textdomain if one exists.
*
* @deprecated 3.1.1.3
* @see https://github.com/10up/grunt-wp-plugin/issues/21#issuecomment-62003284
*/
public function load_old_textdomain( $mofile, $textdomain ) {
Expand Down
26 changes: 2 additions & 24 deletions includes/database/engine/class-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -846,30 +846,8 @@ private function set_db_version( $version = '' ) {
*/
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 );
}

/**
Expand Down
18 changes: 16 additions & 2 deletions includes/database/tables/class-customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -48,9 +48,9 @@ final class Customers extends Table {
* @var array
*/
protected $upgrades = array(
'202002141' => 202002141,
'202006101' => 202006101,
'202301021' => 202301021,
'202303220' => 202303220,
);

/**
Expand Down Expand Up @@ -248,4 +248,18 @@ protected function __202301021() {

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;
}
}
2 changes: 1 addition & 1 deletion includes/gateways/.stripe-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a63eec57c1f5da47c09cc9cd8cf4162f8c65652a
47178f1567076390fc6f41a5c5ebdf986b915165
2 changes: 1 addition & 1 deletion includes/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ function edd_process_profile_editor_updates( $data ) {
$customers = edd_get_customers(
array(
'email' => $email,
'user_id__not_in' => $user_id,
'user_id__not_in' => array( $user_id ),
)
);
// Make sure the new email doesn't belong to another user.
Expand Down
Loading

0 comments on commit 8f2c130

Please sign in to comment.