Updates to 8.2.1

This commit is contained in:
WooCommerce 2025-12-24 10:19:37 +00:00
parent c7e30d354e
commit bfe7fb609d
12 changed files with 8947 additions and 3756 deletions

View File

@ -1,5 +1,12 @@
*** WooCommerce Subscriptions Changelog ***
2025-12-22 - version 8.2.1
* Fix: Subscription pricing strings now correctly display singular and plural billing intervals like "$10 / month" and "$10 every 3 months" in cart and checkout totals.
* Fix: Display all recurring coupon names in the totals section of classic cart and checkout when multiple recurring coupons are applied.
* Fix: Payment method selector options on Subscriptions list page are now properly displaying the payment method name for gateways providing multiple payment methods.
* Fix: PayPal Standard plugin IPN renewal orders not being created for failed payment retries.
* Fix: Prevent fatal errors on shop pages when special characters like % are used in a product name.
2025-12-10 - version 8.2.0
* Fix: Various accessibility issues.
* Added button roles.

View File

@ -1171,7 +1171,7 @@ class WCS_Admin_Post_Types {
// @phpstan-ignore property.notFound
foreach ( WC()->payment_gateways->get_available_payment_gateways() as $gateway_id => $gateway ) {
echo '<option value="' . esc_attr( $gateway_id ) . '"' . ( $selected_gateway_id === $gateway_id ? 'selected' : '' ) . '>' . esc_html( $gateway->title ) . '</option>';
echo '<option value="' . esc_attr( $gateway_id ) . '"' . ( $selected_gateway_id === $gateway_id ? 'selected' : '' ) . '>' . esc_html( method_exists( $gateway, 'get_title' ) ? $gateway->get_title() : $gateway->title ) . '</option>';
}
echo '<option value="_manual_renewal">' . esc_html__( 'Manual Renewal', 'woocommerce-subscriptions' ) . '</option>';
?>

View File

@ -99,7 +99,7 @@ class WC_Product_Subscription extends WC_Product_Simple {
);
}
return apply_filters( 'woocommerce_product_add_to_cart_description', sprintf( $text, $this->get_name() ), $this );
return apply_filters( 'woocommerce_product_add_to_cart_description', $text, $this );
}
/**

View File

@ -383,17 +383,10 @@ class WC_Subscriptions_Product {
}
break;
}
} elseif ( 1 === $billing_interval ) {
$subscription_string = sprintf(
// translators: 1$: recurring amount, 2$: subscription period (e.g. "month") (e.g. "$15 / month").
__( '%1$s / %2$s', 'woocommerce-subscriptions' ),
$price,
wcs_get_subscription_period_strings( $billing_interval, $billing_period )
);
} else {
$subscription_string = sprintf(
// translators: 1$: recurring amount, 2$: subscription period (e.g. "3 months") (e.g. "$15 every 2nd month").
__( '%1$s every %2$s', 'woocommerce-subscriptions' ),
// translators: 1$: recurring amount, 2$: subscription period (e.g. "month" or "3 months") (e.g. "$15 / month" or "$15 every 2nd month").
_n( '%1$s / %2$s', '%1$s every %2$s', $billing_interval, 'woocommerce-subscriptions' ),
$price,
wcs_get_subscription_period_strings( $billing_interval, $billing_period )
);

View File

@ -190,7 +190,7 @@ class WCS_PayPal_Standard_IPN_Handler extends WC_Gateway_Paypal_IPN_Handler {
$transaction_order = wc_get_order( substr( $transaction_details['invoice'], strrpos( $transaction_details['invoice'], '-' ) + 1 ) );
// check if the failed signup has been previously recorded
if ( wcs_get_objects_property( $transaction_order, 'id' ) !== $subscription->get_meta( '_paypal_failed_sign_up_recorded', true ) ) {
if ( wcs_get_objects_property( $transaction_order, 'id' ) !== (int) $subscription->get_meta( '_paypal_failed_sign_up_recorded', true ) ) {
$is_renewal_sign_up_after_failure = true;
}
}

View File

@ -190,22 +190,12 @@ function wcs_price_string( $subscription_details ) {
break;
}
} elseif ( ! empty( $subscription_details['initial_amount'] ) ) {
if ( 1 === $subscription_details['subscription_interval'] ) {
// translators: 1$: initial amount, 2$: initial description (e.g. "up front"), 3$: recurring amount, 4$: subscription period (e.g. "month")
$subscription_string = sprintf( __( '%1$s %2$s then %3$s / %4$s', 'woocommerce-subscriptions' ), $initial_amount_string, $subscription_details['initial_description'], $recurring_amount_string, $subscription_period_string );
} else {
// translators: 1$: initial amount, 2$: initial description (e.g. "up front"), 3$: recurring amount, 4$: subscription period (e.g. "3 months")
$subscription_string = sprintf( __( '%1$s %2$s then %3$s every %4$s', 'woocommerce-subscriptions' ), $initial_amount_string, $subscription_details['initial_description'], $recurring_amount_string, $subscription_period_string );
}
// translators: 1$: initial amount, 2$: initial description (e.g. "up front"), 3$: recurring amount, 4$: subscription period (e.g. "month" or "3 months")
$subscription_string = sprintf( _n( '%1$s %2$s then %3$s / %4$s', '%1$s %2$s then %3$s every %4$s', $subscription_details['subscription_interval'], 'woocommerce-subscriptions' ), $initial_amount_string, $subscription_details['initial_description'], $recurring_amount_string, $subscription_period_string );
} elseif ( ! empty( $subscription_details['recurring_amount'] ) || intval( $subscription_details['recurring_amount'] ) === 0 ) {
if ( true === $subscription_details['use_per_slash'] ) {
if ( 1 === $subscription_details['subscription_interval'] ) {
// translators: 1$: recurring amount, 2$: subscription period (e.g. "month") (e.g. "$15 / month")
$subscription_string = sprintf( __( '%1$s / %2$s', 'woocommerce-subscriptions' ), $recurring_amount_string, $subscription_period_string );
} else {
// translators: 1$: recurring amount, 2$: subscription period (e.g. "3 months") (e.g. "$15 every 2nd month")
$subscription_string = sprintf( __( '%1$s every %2$s', 'woocommerce-subscriptions' ), $recurring_amount_string, $subscription_period_string );
}
// translators: 1$: recurring amount, 2$: subscription period (e.g. "month" or "3 months") (e.g. "$15 / month" or "$15 every 2nd month")
$subscription_string = sprintf( _n( '%1$s / %2$s', '%1$s every %2$s', $subscription_details['subscription_interval'], 'woocommerce-subscriptions' ), $recurring_amount_string, $subscription_period_string );
} else {
// translators: %1$: recurring amount (e.g. "$15"), %2$: subscription period (e.g. "month") (e.g. "$15 every 2nd month")
$subscription_string = sprintf( __( '%1$s every %2$s', 'woocommerce-subscriptions' ), $recurring_amount_string, $subscription_period_string );

View File

@ -19,6 +19,11 @@ class WC_Subscription_Downloads_Settings {
* @since 8.0.0
*/
public static function add_notice_about_bundled_feature() {
if ( ! Constants::is_true( 'WCS_ALLOW_SUBSCRIPTION_DOWNLOADS' ) ) {
// TODO: remove this conditional as soon as we are ready to make subscription downloads functionality live.
return;
}
$screen = get_current_screen();
if ( ! $screen ) {
return false;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -8,9 +8,9 @@
*/
defined( 'ABSPATH' ) || exit;
$display_heading = true;
foreach ( WC()->cart->get_coupons() as $code => $coupon ) {
$display_heading = true;
foreach ( $recurring_carts as $recurring_cart_key => $recurring_cart ) {
foreach ( $recurring_cart->get_coupons() as $recurring_code => $recurring_coupon ) {
if ( $recurring_code !== $code ) {

View File

@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'woocommerce/woocommerce-subscriptions',
'pretty_version' => 'dev-release/8.2.0',
'version' => 'dev-release/8.2.0',
'reference' => '649a58503cd3715ecc5d37281a2cbb62fe5ad320',
'pretty_version' => 'dev-release/8.2.1',
'version' => 'dev-release/8.2.1',
'reference' => '8bb99631f731722b758f4702dc319ae43043ed67',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -29,9 +29,9 @@
'dev_requirement' => false,
),
'woocommerce/woocommerce-subscriptions' => array(
'pretty_version' => 'dev-release/8.2.0',
'version' => 'dev-release/8.2.0',
'reference' => '649a58503cd3715ecc5d37281a2cbb62fe5ad320',
'pretty_version' => 'dev-release/8.2.1',
'version' => 'dev-release/8.2.1',
'reference' => '8bb99631f731722b758f4702dc319ae43043ed67',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),

View File

@ -5,11 +5,11 @@
* Description: Sell products and services with recurring payments in your WooCommerce Store.
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Version: 8.2.0
* Version: 8.2.1
* Requires Plugins: woocommerce
*
* WC requires at least: 10.3.0
* WC tested up to: 10.4.0
* WC tested up to: 10.4.3
* Requires PHP: 7.4
*
* License: GNU General Public License v3.0
@ -84,7 +84,7 @@ class WC_Subscriptions {
public static $plugin_file = __FILE__;
/** @var string */
public static $version = '8.2.0'; // WRCS: DEFINED_VERSION.
public static $version = '8.2.1'; // WRCS: DEFINED_VERSION.
/** @var string */
public static $wc_minimum_supported_version = '7.7';