Skip to content

Commit

Permalink
Merge pull request #9753 from awesomemotive/release/3.3.3
Browse files Browse the repository at this point in the history
Adding 3.3.3 changes
  • Loading branch information
cklosowski authored Aug 6, 2024
2 parents 07c5f45 + ee334bb commit a58152a
Show file tree
Hide file tree
Showing 69 changed files with 6,818 additions and 823 deletions.
9 changes: 9 additions & 0 deletions assets/css/components/admin-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
&__wrapper {
background-color: $white;
box-shadow: inset 0 -3px $edd-very-light-gray;
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 0 10px -20px;
padding: 0 20px;
position: sticky;
Expand All @@ -11,6 +14,12 @@
@media screen and (max-width: $break-medium) {
top: auto;
position: relative;
justify-content: center;
flex-wrap: wrap;

.subtitle {
padding: 18px 12px;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion assets/css/edd-admin-rtl.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/edd-admin.min.css

Large diffs are not rendered by default.

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

// Exit if accessed directly.
Expand Down Expand Up @@ -166,5 +166,5 @@ function edd_lite_notice() {
define( 'EDD_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}

require_once dirname( __FILE__ ) . '/includes/class-edd-requirements-check.php';
new EDD_Requirements_Check();
require_once __DIR__ . '/vendor/autoload.php';
new EDD\RequirementsCheck();
183 changes: 183 additions & 0 deletions includes/admin/admin-deprecated-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1059,3 +1059,186 @@ function edd_taxonomies_tabs() {
// Output the tabs.
edd_display_product_tabs();
}

/**
* Misc File Download Settings Sanitization
*
* @since 2.5
* @deprecated 3.3.3 Moved to EDD\Admin\Settings\Sanitize
*
* @param array $input The value inputted in the field.
*
* @return string $input Sanitized value
*/
function edd_settings_sanitize_misc_file_downloads( $input ) {

if ( ! current_user_can( 'manage_shop_settings' ) ) {
return $input;
}

_edd_deprecated_function( __FUNCTION__, '3.3.3', 'EDD\Admin\Settings\Sanitize\Tabs\Misc\FileDownloads::additional_processing' );

if ( edd_get_file_download_method() != $input['download_method'] || ! edd_htaccess_exists() ) {
// Force the .htaccess files to be updated if the Download method was changed.
edd_create_protection_files( true, $input['download_method'] );
}

return $input;
}

/**
* Misc Accounting Settings Sanitization
*
* @since 2.5
* @deprecated 3.3.3 Moved to EDD\Admin\Settings\Sanitize
*
* @param array $input The value inputted in the field.
*
* @return array $input Sanitized value
*/
function edd_settings_sanitize_misc_accounting( $input ) {

if ( ! current_user_can( 'manage_shop_settings' ) ) {
return $input;
}

return $input;
}

/**
* Sanitizes banned emails.
*
* @since 3.0
* @deprecated 3.3.3 Moved to EDD\Admin\Settings\Sanitize
*/
function edd_sanitize_banned_emails( $input ) {

$emails = '';
if ( ! empty( $input['banned_emails'] ) ) {
// Sanitize the input.
$emails = array_map( 'trim', explode( "\n", $input['banned_emails'] ) );
$emails = array_unique( $emails );
$emails = array_map( 'sanitize_text_field', $emails );

foreach ( $emails as $id => $email ) {
if ( ! is_email( $email ) && $email[0] != '@' && $email[0] != '.' ) {
unset( $emails[ $id ] );
}
}
}
$input['banned_emails'] = $emails;

return $input;
}

/**
* Payment Gateways Settings Sanitization
*
* @since 2.7
* @deprecated 3.3.3 Moved to EDD\Admin\Settings\Sanitize
*
* @param array $input The value inputted in the field
*
* @return string $input Sanitized value
*/
function edd_settings_sanitize_gateways( $input = array() ) {

// Bail if user cannot manage shop settings
if ( ! current_user_can( 'manage_shop_settings' ) || empty( $input['default_gateway'] ) ) {
return $input;
}

// Unset the default gateway if there are no `gateways` enabled
if ( empty( $input['gateways'] ) || '-1' == $input['gateways'] ) {
unset( $input['default_gateway'] );

// Current gateway is no longer enabled, so
} elseif ( ! array_key_exists( $input['default_gateway'], $input['gateways'] ) ) {
$enabled_gateways = $input['gateways'];

reset( $enabled_gateways );

$first_gateway = key( $enabled_gateways );

if ( $first_gateway ) {
$input['default_gateway'] = $first_gateway;
}
}

return $input;
}

/**
* Taxes Settings Sanitization
*
* Adds a settings error (for the updated message)
* This also saves the tax rates table
*
* @since 1.6
* @deprecated 3.3.3 Moved to EDD\Admin\Settings\Sanitize
*
* @param array $input The value inputted in the field
*
* @return array $input Sanitized value.
*/
function edd_settings_sanitize_taxes( $input ) {

if ( ! current_user_can( 'manage_shop_settings' ) ) {
return $input;
}

if ( ! isset( $_POST['tax_rates'] ) ) {
return $input;
}

$tax_rates = ! empty( $_POST['tax_rates'] )
? $_POST['tax_rates']
: array();

foreach ( $tax_rates as $tax_rate ) {

$scope = isset( $tax_rate['global'] )
? 'country'
: 'region';

$region = isset( $tax_rate['state'] )
? sanitize_text_field( $tax_rate['state'] )
: '';

$name = '*' === $tax_rate['country']
? ''
: sanitize_text_field( $tax_rate['country'] );

if ( empty( $name ) ) {
$scope = 'global';
}

$adjustment_data = array(
'name' => $name,
'type' => 'tax_rate',
'scope' => $scope,
'amount_type' => 'percent',
'amount' => floatval( $tax_rate['rate'] ),
'description' => $region,
);

if ( ( empty( $adjustment_data['name'] ) && 'global' !== $adjustment_data['scope'] ) || $adjustment_data['amount'] < 0 ) {
continue;
}

$existing_adjustment = edd_get_adjustments( $adjustment_data );

if ( ! empty( $existing_adjustment ) ) {
$adjustment = $existing_adjustment[0];
$adjustment_data['status'] = sanitize_text_field( $tax_rate['status'] );

edd_update_adjustment( $adjustment->id, $adjustment_data );
} else {
$adjustment_data['status'] = 'active';

edd_add_tax_rate( $adjustment_data );
}
}

return $input;
}
33 changes: 20 additions & 13 deletions includes/admin/reporting/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,15 @@ function edd_register_refunds_report( $reports ) {
'tile' => array(
'data_callback' => function () use ( $dates, $currency ) {
$stats = new EDD\Stats();
$number = $stats->get_order_refund_count( array(
'range' => $dates['range'],
'currency' => $currency
) );
return esc_html( $number );

return esc_html(
$stats->get_order_refund_count(
array(
'range' => $dates['range'],
'currency' => $currency,
)
)
);
},
'display_args' => array(
'comparison_label' => $label,
Expand All @@ -1069,12 +1073,16 @@ function edd_register_refunds_report( $reports ) {
'tile' => array(
'data_callback' => function () use ( $dates, $currency ) {
$stats = new EDD\Stats();
$number = $stats->get_order_refund_count( array(
'range' => $dates['range'],
'status' => array( 'complete' ),
'currency' => $currency
) );
return esc_html( $number );

return esc_html(
$stats->get_order_refund_count(
array(
'range' => $dates['range'],
'currency' => $currency,
'fully_refunded' => true,
)
)
);
},
'display_args' => array(
'comparison_label' => $label,
Expand All @@ -1091,8 +1099,7 @@ function edd_register_refunds_report( $reports ) {
$stats = new EDD\Stats();
$number = $stats->get_order_item_refund_count( array(
'range' => $dates['range'],
'status' => array( 'refunded' ),
'currency' => $currency
'currency' => $currency,
) );
return esc_html( $number );
},
Expand Down
Loading

0 comments on commit a58152a

Please sign in to comment.