From b811acfcf36e0f801affa57068cdfc844aa854b0 Mon Sep 17 00:00:00 2001 From: WooCommerce Date: Mon, 14 Oct 2024 10:16:27 +0000 Subject: [PATCH] Updates to 6.7.0 --- changelog.txt | 8 + .../admin/class-wcs-retry-admin.php | 18 ++ languages/woocommerce-subscriptions.pot | 194 +++++++++--------- vendor/autoload.php | 2 +- vendor/composer/ClassLoader.php | 96 ++++----- vendor/composer/autoload_real.php | 8 +- vendor/composer/autoload_static.php | 8 +- vendor/composer/installed.json | 14 +- vendor/composer/installed.php | 18 +- .../subscriptions-core/changelog.txt | 7 + .../admin/class-wcs-wc-admin-manager.php | 3 + .../includes/class-wc-subscription.php | 16 +- .../class-wc-subscriptions-core-plugin.php | 8 +- .../includes/class-wc-subscriptions-email.php | 13 ++ ...s-orders-table-subscription-data-store.php | 2 +- .../class-wcs-subscription-data-store-cpt.php | 2 +- .../woocommerce-subscriptions-core.php | 2 +- woocommerce-subscriptions.php | 4 +- 18 files changed, 240 insertions(+), 183 deletions(-) diff --git a/changelog.txt b/changelog.txt index eb587d2..4ff4cf9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,13 @@ *** WooCommerce Subscriptions Changelog *** +2024-10-14 - version 6.8.0 +* Fix: Restore Retry icon in Orders table for HPOS-enabled stores. +* Fix: Correctly updates a subscription status to `cancelled` during a payment failure call when the current status is `pending-cancel`. +* Fix: Clear the `cancelled_email_sent` meta when a subscription is reactivated to allow the customer to receive future cancellation emails. +* Fix: Prevent deprecation notices after updating to WooCommerce 9.3. +* Fix: Prevent PHP fatal error that occurs when calculating the total tax refunded on a subscription. +* Dev: Only initialise the `WCS_WC_Admin_Manager` class on stores running WC 9.2 or older. This class handled integration with the Woo Navigation feature that was removed in WC 9.3. + 2024-09-13 - version 6.7.0 * Fix: Resolved two issues preventing the correct display of the "Subscription items can no longer be edited." message on the Edit Subscription page. * Fix: Checks for the existence of `wc_get_page_screen_id` before calling it on `wcs_get_page_screen_id`, and for the admin context before calling `list_table_primary_column` to prevent fatal errors. diff --git a/includes/payment-retry/admin/class-wcs-retry-admin.php b/includes/payment-retry/admin/class-wcs-retry-admin.php index ac21e4f..727e72e 100644 --- a/includes/payment-retry/admin/class-wcs-retry-admin.php +++ b/includes/payment-retry/admin/class-wcs-retry-admin.php @@ -36,6 +36,9 @@ public function __construct( $setting_id ) { // Display the number of retries in the Orders list table add_action( 'manage_shop_order_posts_custom_column', __CLASS__ . '::add_column_content', 20, 2 ); + // HPOS - Display the number of retries in the Orders list table + add_action( 'woocommerce_shop_order_list_table_custom_column', __CLASS__ . '::add_column_content_list_table', 10, 2 ); + add_filter( 'wcs_system_status', array( $this, 'add_system_status_content' ) ); } } @@ -143,6 +146,21 @@ public static function add_column_content( $column, $post_id ) { } } + /** + * Display the number of retries on a renewal order in the Orders list table, + * for HPOS-enabled stores. + * + * @param string $column The column name + * @param WC_Order $order The order object + * + * @return null + */ + public static function add_column_content_list_table( string $column, WC_Order $order ) { + if ( 'subscription_relationship' === $column ) { + self::add_column_content( $column, $order->get_id() ); + } + } + /** * Add a setting to enable/disable the retry system * diff --git a/languages/woocommerce-subscriptions.pot b/languages/woocommerce-subscriptions.pot index 85aa1e0..db5efdd 100644 --- a/languages/woocommerce-subscriptions.pot +++ b/languages/woocommerce-subscriptions.pot @@ -2,16 +2,16 @@ # This file is distributed under the same license as the WooCommerce Subscriptions plugin. msgid "" msgstr "" -"Project-Id-Version: WooCommerce Subscriptions 6.7.0\n" +"Project-Id-Version: WooCommerce Subscriptions 6.8.0\n" "Report-Msgid-Bugs-To: https://woocommerce.com/contact-us\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-09-13T00:40:26+00:00\n" +"POT-Creation-Date: 2024-10-14T07:54:53+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.9.0\n" +"X-Generator: WP-CLI 2.11.0\n" "X-Domain: woocommerce-subscriptions\n" #. Plugin Name of the plugin @@ -53,11 +53,11 @@ msgstr "" #: vendor/woocommerce/subscriptions-core/includes/admin/class-wc-subscriptions-admin.php:1027 #: vendor/woocommerce/subscriptions-core/includes/admin/class-wc-subscriptions-admin.php:1179 #: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-system-status.php:59 -#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:38 -#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:48 -#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:90 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:372 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:385 +#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:41 +#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:51 +#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:93 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:376 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:389 #: vendor/woocommerce/subscriptions-core/includes/class-wcs-query.php:108 #: vendor/woocommerce/subscriptions-core/includes/class-wcs-query.php:133 #: vendor/woocommerce/subscriptions-core/includes/class-wcs-query.php:289 @@ -1076,7 +1076,7 @@ msgid "Add a Subscription Product" msgstr "" #: includes/class-wc-subscriptions-plugin.php:227 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:548 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:552 #: vendor/woocommerce/subscriptions-core/includes/upgrades/templates/wcs-about-2-0.php:35 #: vendor/woocommerce/subscriptions-core/includes/upgrades/templates/wcs-about.php:34 msgid "Settings" @@ -1441,79 +1441,79 @@ msgstr "" msgid "Find new gateways that %1$ssupport automatic subscription payments%2$s in the official %3$sWooCommerce Marketplace%4$s." msgstr "" -#: includes/payment-retry/admin/class-wcs-retry-admin.php:64 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:67 msgid "Automatic Failed Payment Retries" msgstr "" #. translators: %d: retry count. -#: includes/payment-retry/admin/class-wcs-retry-admin.php:118 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:121 msgid "%d Pending Payment Retry" msgid_plural "%d Pending Payment Retries" msgstr[0] "" msgstr[1] "" #. translators: %d: retry count. -#: includes/payment-retry/admin/class-wcs-retry-admin.php:122 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:125 msgid "%d Processing Payment Retry" msgid_plural "%d Processing Payment Retries" msgstr[0] "" msgstr[1] "" #. translators: %d: retry count. -#: includes/payment-retry/admin/class-wcs-retry-admin.php:126 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:129 msgid "%d Failed Payment Retry" msgid_plural "%d Failed Payment Retries" msgstr[0] "" msgstr[1] "" #. translators: %d: retry count. -#: includes/payment-retry/admin/class-wcs-retry-admin.php:130 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:133 msgid "%d Successful Payment Retry" msgid_plural "%d Successful Payment Retries" msgstr[0] "" msgstr[1] "" #. translators: %d: retry count. -#: includes/payment-retry/admin/class-wcs-retry-admin.php:134 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:137 msgid "%d Cancelled Payment Retry" msgid_plural "%d Cancelled Payment Retries" msgstr[0] "" msgstr[1] "" -#: includes/payment-retry/admin/class-wcs-retry-admin.php:162 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:180 msgid "Retry Failed Payments" msgstr "" -#: includes/payment-retry/admin/class-wcs-retry-admin.php:163 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:181 msgid "Enable automatic retry of failed recurring payments" msgstr "" #. translators: 1,2: opening/closing link tags (to documentation). -#: includes/payment-retry/admin/class-wcs-retry-admin.php:168 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:186 msgid "Attempt to recover recurring revenue that would otherwise be lost due to payment methods being declined only temporarily. %1$sLearn more%2$s." msgstr "" -#: includes/payment-retry/admin/class-wcs-retry-admin.php:190 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:208 msgctxt "label for the system status page" msgid "Custom Retry Rules" msgstr "" -#: includes/payment-retry/admin/class-wcs-retry-admin.php:198 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:216 msgctxt "label for the system status page" msgid "Custom Retry Rule Class" msgstr "" -#: includes/payment-retry/admin/class-wcs-retry-admin.php:206 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:224 msgctxt "label for the system status page" msgid "Custom Raw Retry Rule" msgstr "" -#: includes/payment-retry/admin/class-wcs-retry-admin.php:214 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:232 msgctxt "label for the system status page" msgid "Custom Retry Rule" msgstr "" -#: includes/payment-retry/admin/class-wcs-retry-admin.php:222 +#: includes/payment-retry/admin/class-wcs-retry-admin.php:240 msgctxt "label for the system status page" msgid "Retries Migration Status" msgstr "" @@ -1934,6 +1934,46 @@ msgstr "" msgid "Want to renew early via the checkout? Click %shere.%s" msgstr "" +#: tests/unit/scheduler/scheduler.php:65 +#: vendor/woocommerce/subscriptions-core/wcs-functions.php:290 +msgctxt "table heading" +msgid "Start Date" +msgstr "" + +#: tests/unit/scheduler/scheduler.php:66 +#: vendor/woocommerce/subscriptions-core/wcs-functions.php:291 +msgctxt "table heading" +msgid "Trial End" +msgstr "" + +#: tests/unit/scheduler/scheduler.php:67 +#: vendor/woocommerce/subscriptions-core/templates/myaccount/my-subscriptions.php:43 +#: vendor/woocommerce/subscriptions-core/wcs-functions.php:292 +msgctxt "table heading" +msgid "Next Payment" +msgstr "" + +#: tests/unit/scheduler/scheduler.php:68 +#: vendor/woocommerce/subscriptions-core/templates/emails/cancelled-subscription.php:23 +#: vendor/woocommerce/subscriptions-core/templates/emails/expired-subscription.php:23 +#: vendor/woocommerce/subscriptions-core/templates/emails/on-hold-subscription.php:23 +#: vendor/woocommerce/subscriptions-core/wcs-functions.php:293 +msgctxt "table heading" +msgid "Last Order Date" +msgstr "" + +#: tests/unit/scheduler/scheduler.php:69 +#: vendor/woocommerce/subscriptions-core/wcs-functions.php:294 +msgctxt "table heading" +msgid "Cancelled Date" +msgstr "" + +#: tests/unit/scheduler/scheduler.php:70 +#: vendor/woocommerce/subscriptions-core/wcs-functions.php:295 +msgctxt "table heading" +msgid "End Date" +msgstr "" + #. translators: 1: relation type, 2: list of valid relation types. #: vendor/woocommerce/subscriptions-core/includes/abstracts/abstract-wcs-related-order-store.php:148 msgid "Invalid relation type: %1$s. Order relationship type must be one of: %2$s." @@ -2147,7 +2187,7 @@ msgid "Manage Subscriptions" msgstr "" #: vendor/woocommerce/subscriptions-core/includes/admin/class-wc-subscriptions-admin.php:1005 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:381 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:385 msgid "Search Subscriptions" msgstr "" @@ -2450,7 +2490,7 @@ msgid "Status" msgstr "" #: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-post-types.php:469 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:373 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:377 #: vendor/woocommerce/subscriptions-core/templates/emails/cancelled-subscription.php:21 #: vendor/woocommerce/subscriptions-core/templates/emails/expired-subscription.php:21 #: vendor/woocommerce/subscriptions-core/templates/emails/on-hold-subscription.php:21 @@ -2540,7 +2580,7 @@ msgstr[1] "" #. translators: placeholder is the display name of a payment gateway a subscription was paid by #. translators: %s: payment method. #: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-post-types.php:652 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2164 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2168 msgid "Via %s" msgstr "" @@ -2608,7 +2648,7 @@ msgid "None" msgstr "" #: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-post-types.php:1174 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2146 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2150 #: vendor/woocommerce/subscriptions-core/includes/class-wcs-change-payment-method-admin.php:170 msgid "Manual Renewal" msgstr "" @@ -2754,11 +2794,11 @@ msgctxt "label for the system status page" msgid "Country / State" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:59 +#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:62 msgid "Add New" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:69 +#: vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php:72 msgid "Edit Subscription" msgstr "" @@ -3032,7 +3072,7 @@ msgstr "" #. translators: %d: subscription ID. #. translators: %d: order ID. #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:1457 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2587 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2591 msgid "Subscription #%d: " msgstr "" @@ -3048,59 +3088,59 @@ msgstr "" msgid "Subscription Cancelled: maximum number of failed payments reached." msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2028 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2032 msgid "The \"all\" value for $order_type parameter is deprecated. It was a misnomer, as it did not return resubscribe orders. It was also inconsistent with order type values accepted by wcs_get_subscription_orders(). Use array( \"parent\", \"renewal\", \"switch\" ) to maintain previous behaviour, or \"any\" to receive all order types, including switch and resubscribe." msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2243 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2247 #: vendor/woocommerce/subscriptions-core/wcs-functions.php:834 msgid "Payment method meta must be an array." msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2479 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2483 msgid "Invalid format. First parameter needs to be an array." msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2483 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2487 msgid "Invalid data. First parameter was empty when passed to update_dates()." msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2490 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2494 msgid "Invalid data. First parameter has a date that is not in the registered date types." msgstr "" #. translators: placeholder is date type (e.g. "end", "next_payment"...) -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2517 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2521 msgctxt "appears in an error message if date is wrong format" msgid "Invalid %s date. The date must be of the format: \"Y-m-d H:i:s\"." msgstr "" #. translators: %s: date type (e.g. "end"). -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2555 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2559 msgid "The %s date must occur after the cancellation date." msgstr "" #. translators: %s: date type (e.g. "end"). -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2561 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2565 msgid "The %s date must occur after the last payment date." msgstr "" #. translators: %s: date type (e.g. "end"). -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2566 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2570 msgid "The %s date must occur after the next payment date." msgstr "" #. translators: %s: date type (e.g. "end"). -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2572 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2576 msgid "The %s date must occur after the trial end date." msgstr "" #. translators: %s: date type (e.g. "next_payment"). -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2577 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2581 msgid "The %s date must occur after the start date." msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2607 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php:2611 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-checkout.php:348 msgid "Backordered" msgstr "" @@ -3364,53 +3404,53 @@ msgstr "" msgid "Purchasing a subscription product requires an account. Please go to the %1$sMy Account%2$s page to login or contact us if you need assistance." msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:374 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:378 msgctxt "custom post type setting" msgid "Add Subscription" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:375 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:379 msgctxt "custom post type setting" msgid "Add New Subscription" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:376 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:380 msgctxt "custom post type setting" msgid "Edit" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:377 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:381 msgctxt "custom post type setting" msgid "Edit Subscription" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:378 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:382 msgctxt "custom post type setting" msgid "New Subscription" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:379 -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:380 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:383 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:384 msgctxt "custom post type setting" msgid "View Subscription" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:383 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:387 msgctxt "custom post type setting" msgid "No Subscriptions found in trash" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:384 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:388 msgctxt "custom post type setting" msgid "Parent Subscriptions" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:387 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:391 msgid "This is where subscriptions are stored." msgstr "" #. translators: placeholder is a post count. -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:445 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:449 msgctxt "post status label including post count" msgid "Active (%s)" msgid_plural "Active (%s)" @@ -3418,7 +3458,7 @@ msgstr[0] "" msgstr[1] "" #. translators: placeholder is a post count. -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:447 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:451 msgctxt "post status label including post count" msgid "Switched (%s)" msgid_plural "Switched (%s)" @@ -3426,7 +3466,7 @@ msgstr[0] "" msgstr[1] "" #. translators: placeholder is a post count. -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:449 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:453 msgctxt "post status label including post count" msgid "Expired (%s)" msgid_plural "Expired (%s)" @@ -3434,29 +3474,29 @@ msgstr[0] "" msgstr[1] "" #. translators: placeholder is a post count. -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:451 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:455 msgctxt "post status label including post count" msgid "Pending Cancellation (%s)" msgid_plural "Pending Cancellation (%s)" msgstr[0] "" msgstr[1] "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:500 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:504 msgid "Variable Subscription" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:549 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:553 #: vendor/woocommerce/subscriptions-core/includes/upgrades/templates/wcs-about-2-0.php:36 msgctxt "short for documents" msgid "Docs" msgstr "" -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:550 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:554 msgid "Support" msgstr "" #. translators: placeholders are opening and closing tags. Leads to docs on upgrading WooCommerce Subscriptions -#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:573 +#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php:577 msgid "Warning! Version 2.0 is a major update to the WooCommerce Subscriptions extension. Before updating, please create a backup, update all WooCommerce extensions and test all plugins, custom code and payment gateways with version 2.0 on a staging site. %1$sLearn more about updating older versions of WooCommerce Subscriptions »%2$s" msgstr "" @@ -6420,14 +6460,6 @@ msgctxt "table headings in notification email" msgid "Price" msgstr "" -#: vendor/woocommerce/subscriptions-core/templates/emails/cancelled-subscription.php:23 -#: vendor/woocommerce/subscriptions-core/templates/emails/expired-subscription.php:23 -#: vendor/woocommerce/subscriptions-core/templates/emails/on-hold-subscription.php:23 -#: vendor/woocommerce/subscriptions-core/wcs-functions.php:293 -msgctxt "table heading" -msgid "Last Order Date" -msgstr "" - #: vendor/woocommerce/subscriptions-core/templates/emails/cancelled-subscription.php:24 msgctxt "table headings in notification email" msgid "End of Prepaid Term" @@ -6716,12 +6748,6 @@ msgstr "" msgid "View subscription number %s" msgstr "" -#: vendor/woocommerce/subscriptions-core/templates/myaccount/my-subscriptions.php:43 -#: vendor/woocommerce/subscriptions-core/wcs-functions.php:292 -msgctxt "table heading" -msgid "Next Payment" -msgstr "" - #: vendor/woocommerce/subscriptions-core/templates/myaccount/my-subscriptions.php:49 #: vendor/woocommerce/subscriptions-core/templates/myaccount/related-orders.php:54 #: vendor/woocommerce/subscriptions-core/templates/myaccount/related-subscriptions.php:43 @@ -6906,26 +6932,6 @@ msgstr "" msgid "Can not get address type display name. Address type is not a string." msgstr "" -#: vendor/woocommerce/subscriptions-core/wcs-functions.php:290 -msgctxt "table heading" -msgid "Start Date" -msgstr "" - -#: vendor/woocommerce/subscriptions-core/wcs-functions.php:291 -msgctxt "table heading" -msgid "Trial End" -msgstr "" - -#: vendor/woocommerce/subscriptions-core/wcs-functions.php:294 -msgctxt "table heading" -msgid "Cancelled Date" -msgstr "" - -#: vendor/woocommerce/subscriptions-core/wcs-functions.php:295 -msgctxt "table heading" -msgid "End Date" -msgstr "" - #: vendor/woocommerce/subscriptions-core/wcs-functions.php:330 msgid "Date type is not a string." msgstr "" diff --git a/vendor/autoload.php b/vendor/autoload.php index ddabd56..ae7c20f 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit0a0744246f082255078926698437a7a5::getLoader(); +return ComposerAutoloaderInit13fede8eb22b3733f757156a27f6ebe3::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index a72151c..7824d8f 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -45,35 +45,34 @@ class ClassLoader /** @var \Closure(string):void */ private static $includeFile; - /** @var ?string */ + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr0 = array(); @@ -81,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array + * @var array */ private $classMap = array(); @@ -90,21 +88,20 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array + * @var array */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { @@ -113,7 +110,7 @@ public function __construct($vendorDir = null) } /** - * @return string[] + * @return array> */ public function getPrefixes() { @@ -125,8 +122,7 @@ public function getPrefixes() } /** - * @return array[] - * @psalm-return array> + * @return array> */ public function getPrefixesPsr4() { @@ -134,8 +130,7 @@ public function getPrefixesPsr4() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirs() { @@ -143,8 +138,7 @@ public function getFallbackDirs() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirsPsr4() { @@ -152,8 +146,7 @@ public function getFallbackDirsPsr4() } /** - * @return string[] Array of classname => path - * @psalm-return array + * @return array Array of classname => path */ public function getClassMap() { @@ -161,8 +154,7 @@ public function getClassMap() } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap + * @param array $classMap Class to filename map * * @return void */ @@ -179,24 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -205,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -226,9 +219,9 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -236,17 +229,18 @@ public function add($prefix, $paths, $prepend = false) */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -256,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -276,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories * * @return void */ @@ -294,8 +288,8 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -481,9 +475,9 @@ public function findFile($class) } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 59bc872..9bcdab2 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit0a0744246f082255078926698437a7a5 +class ComposerAutoloaderInit13fede8eb22b3733f757156a27f6ebe3 { private static $loader; @@ -24,12 +24,12 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInit0a0744246f082255078926698437a7a5', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit13fede8eb22b3733f757156a27f6ebe3', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit0a0744246f082255078926698437a7a5', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit13fede8eb22b3733f757156a27f6ebe3', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit0a0744246f082255078926698437a7a5::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit13fede8eb22b3733f757156a27f6ebe3::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index c279058..8b53e43 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit0a0744246f082255078926698437a7a5 +class ComposerStaticInit13fede8eb22b3733f757156a27f6ebe3 { public static $prefixLengthsPsr4 = array ( 'C' => @@ -129,9 +129,9 @@ class ComposerStaticInit0a0744246f082255078926698437a7a5 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit0a0744246f082255078926698437a7a5::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit0a0744246f082255078926698437a7a5::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit0a0744246f082255078926698437a7a5::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit13fede8eb22b3733f757156a27f6ebe3::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit13fede8eb22b3733f757156a27f6ebe3::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit13fede8eb22b3733f757156a27f6ebe3::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 03624c5..ac0fe59 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -156,17 +156,17 @@ }, { "name": "woocommerce/subscriptions-core", - "version": "7.5.0", - "version_normalized": "7.5.0.0", + "version": "7.6.0", + "version_normalized": "7.6.0.0", "source": { "type": "git", "url": "https://github.com/Automattic/woocommerce-subscriptions-core.git", - "reference": "32bcb16e1a0d87e55214aaff1fa80b45bd1b43df" + "reference": "6bfbf519df799dde8cd9f39e6c93e820e5170352" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/woocommerce-subscriptions-core/zipball/32bcb16e1a0d87e55214aaff1fa80b45bd1b43df", - "reference": "32bcb16e1a0d87e55214aaff1fa80b45bd1b43df", + "url": "https://api.github.com/repos/Automattic/woocommerce-subscriptions-core/zipball/6bfbf519df799dde8cd9f39e6c93e820e5170352", + "reference": "6bfbf519df799dde8cd9f39e6c93e820e5170352", "shasum": "" }, "require": { @@ -179,7 +179,7 @@ "woocommerce/woocommerce-sniffs": "0.1.0", "yoast/phpunit-polyfills": "1.1.0" }, - "time": "2024-09-12T23:46:14+00:00", + "time": "2024-10-14T04:42:25+00:00", "type": "wordpress-plugin", "extra": { "phpcodesniffer-search-depth": 2 @@ -209,7 +209,7 @@ "description": "Sell products and services with recurring payments in your WooCommerce Store.", "homepage": "https://github.com/Automattic/woocommerce-subscriptions-core", "support": { - "source": "https://github.com/Automattic/woocommerce-subscriptions-core/tree/7.5.0", + "source": "https://github.com/Automattic/woocommerce-subscriptions-core/tree/7.6.0", "issues": "https://github.com/Automattic/woocommerce-subscriptions-core/issues" }, "install-path": "../woocommerce/subscriptions-core" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index d85a2e9..490bfd2 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'woocommerce/woocommerce-subscriptions', - 'pretty_version' => 'dev-release/6.7.0', - 'version' => 'dev-release/6.7.0', - 'reference' => '094d1fce371e91c7c3ac11ce7f11eda8f2002eeb', + 'pretty_version' => 'dev-release/6.8.0', + 'version' => 'dev-release/6.8.0', + 'reference' => '08730421b262b38602c261c857ac113aa46d7cbf', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -32,18 +32,18 @@ ), ), 'woocommerce/subscriptions-core' => array( - 'pretty_version' => '7.5.0', - 'version' => '7.5.0.0', - 'reference' => '32bcb16e1a0d87e55214aaff1fa80b45bd1b43df', + 'pretty_version' => '7.6.0', + 'version' => '7.6.0.0', + 'reference' => '6bfbf519df799dde8cd9f39e6c93e820e5170352', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../woocommerce/subscriptions-core', 'aliases' => array(), 'dev_requirement' => false, ), 'woocommerce/woocommerce-subscriptions' => array( - 'pretty_version' => 'dev-release/6.7.0', - 'version' => 'dev-release/6.7.0', - 'reference' => '094d1fce371e91c7c3ac11ce7f11eda8f2002eeb', + 'pretty_version' => 'dev-release/6.8.0', + 'version' => 'dev-release/6.8.0', + 'reference' => '08730421b262b38602c261c857ac113aa46d7cbf', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/vendor/woocommerce/subscriptions-core/changelog.txt b/vendor/woocommerce/subscriptions-core/changelog.txt index 45e04be..c7bef83 100644 --- a/vendor/woocommerce/subscriptions-core/changelog.txt +++ b/vendor/woocommerce/subscriptions-core/changelog.txt @@ -1,5 +1,12 @@ *** WooCommerce Subscriptions Core Changelog *** += 7.6.0 - 2024-10-14 = +* Fix - Correctly updates a subscription status to `cancelled` during a payment failure call when the current status is `pending-cancel`. +* Fix - Clear the `cancelled_email_sent` meta when a subscription is reactivated to allow the customer to receive future cancellation emails. +* Fix - Prevent deprecation notices after updating to WooCommerce 9.3. +* Fix - Prevent PHP fatal error that occurs when calculating the total tax refunded on a subscription. +* Dev - Only initialise the `WCS_WC_Admin_Manager` class on stores running WC 9.2 or older. This class handled integration with the Woo Navigation feature that was removed in WC 9.3. + = 7.5.0 - 2024-09-12 = * Dev - Removing the unused method `maybe_remove_formatted_order_total_filter` hooked to `woocommerce_get_formatted_order_total` which was deprecated. * Fix - Resolved two issues preventing the correct display of the "Subscription items can no longer be edited." message on the Edit Subscription page. diff --git a/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php b/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php index 17c7e51..a6c2795 100644 --- a/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php +++ b/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php @@ -16,6 +16,9 @@ class WCS_WC_Admin_Manager { /** * Initialise the class and attach hook callbacks. + * + * WooCommerce 9.3 removed the new Navigation feature making this class obsolete. + * This class will only be inited on stores running WooCommerce 9.2 or older. */ public static function init() { if ( ! defined( 'WC_ADMIN_PLUGIN_FILE' ) ) { diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php index 30dcf61..a572d24 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php @@ -1913,12 +1913,16 @@ public function payment_failed( $new_status = 'on-hold' ) { $this->add_order_note( __( 'Payment failed.', 'woocommerce-subscriptions' ) ); // Allow a short circuit for plugins & payment gateways to force max failed payments exceeded - if ( 'cancelled' == $new_status || apply_filters( 'woocommerce_subscription_max_failed_payments_exceeded', false, $this ) ) { - if ( $this->can_be_updated_to( 'cancelled' ) ) { - $this->update_status( 'cancelled', __( 'Subscription Cancelled: maximum number of failed payments reached.', 'woocommerce-subscriptions' ) ); - } - } elseif ( $this->can_be_updated_to( $new_status ) ) { - $this->update_status( $new_status ); + // This also forces the new status to be 'cancelled' if the filter is applied or the subscription is pending-cancel + $max_failed_payments = apply_filters( 'woocommerce_subscription_max_failed_payments_exceeded', false, $this ); + $status_note = $max_failed_payments ? __( 'Subscription Cancelled: maximum number of failed payments reached.', 'woocommerce-subscriptions' ) : ''; + + if ( $max_failed_payments || $this->has_status( 'pending-cancel' ) ) { + $new_status = 'cancelled'; + } + + if ( $this->can_be_updated_to( $new_status ) ) { + $this->update_status( $new_status, $status_note ); } do_action( 'woocommerce_subscription_payment_failed', $this, $new_status ); diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php index 2d80622..dae49d8 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php @@ -16,7 +16,7 @@ class WC_Subscriptions_Core_Plugin { * The version of subscriptions-core library. * @var string */ - protected $library_version = '7.5.0'; // WRCS: DEFINED_VERSION. + protected $library_version = '7.6.0'; // WRCS: DEFINED_VERSION. /** * The subscription scheduler instance. @@ -148,7 +148,6 @@ public function init() { add_action( 'init', array( 'WC_Subscriptions_Synchroniser', 'init' ) ); add_action( 'after_setup_theme', array( 'WC_Subscriptions_Upgrader', 'init' ), 11 ); add_action( 'init', array( 'WC_PayPal_Standard_Subscriptions', 'init' ), 11 ); - add_action( 'init', array( 'WCS_WC_Admin_Manager', 'init' ), 11 ); // Attach the callback to load version dependant classes. add_action( 'plugins_loaded', array( $this, 'init_version_dependant_classes' ) ); @@ -212,6 +211,11 @@ public function init_version_dependant_classes() { if ( class_exists( 'WC_Abstract_Privacy' ) ) { new WCS_Privacy(); } + + // Loads Subscriptions support for the WooCommerce Navigation feature. This feature was removed in WC 9.3. + if ( wcs_is_woocommerce_pre( '9.3' ) ) { + add_action( 'init', array( 'WCS_WC_Admin_Manager', 'init' ), 11 ); + } } /** diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-email.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-email.php index 7a72f93..5dd9ca1 100644 --- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-email.php +++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-email.php @@ -26,6 +26,8 @@ public static function init() { add_action( 'woocommerce_subscriptions_email_order_details', __CLASS__ . '::order_download_details', 10, 4 ); add_action( 'woocommerce_subscriptions_email_order_details', __CLASS__ . '::order_details', 10, 4 ); + + add_action( 'woocommerce_subscription_status_pending-cancel_to_active', __CLASS__ . '::maybe_clear_cancelled_email_flag', 10, 4 ); } /** @@ -346,6 +348,17 @@ public static function order_download_details( $order, $sent_to_admin = false, $ } } + /** + * If the subscription was cancelled before, reset the cancelled email sent flag so the customer can be notified of a future cancellation. + * + * @param $subscription WC_Subscription The subscription object. + * @return void + */ + public static function maybe_clear_cancelled_email_flag( $subscription ) { + $subscription->set_cancelled_email_sent( 'false' ); + $subscription->save(); + } + /** * Init the mailer and call the notifications for the current filter. * diff --git a/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-orders-table-subscription-data-store.php b/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-orders-table-subscription-data-store.php index c715af9..f0edd69 100644 --- a/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-orders-table-subscription-data-store.php +++ b/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-orders-table-subscription-data-store.php @@ -247,7 +247,7 @@ public function get_total_refunded( $subscription ) { public function get_total_tax_refunded( $subscription ) { $total = 0; - foreach ( $subscription->get_related_orders() as $order ) { + foreach ( $subscription->get_related_orders( 'all' ) as $order ) { $total += parent::get_total_tax_refunded( $order ); } diff --git a/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-subscription-data-store-cpt.php b/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-subscription-data-store-cpt.php index b28e7a8..cf87304 100644 --- a/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-subscription-data-store-cpt.php +++ b/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-subscription-data-store-cpt.php @@ -305,7 +305,7 @@ public function get_total_tax_refunded( $subscription ) { $total = 0; - foreach ( $subscription->get_related_orders() as $order ) { + foreach ( $subscription->get_related_orders( 'all' ) as $order ) { $total += parent::get_total_tax_refunded( $order ); } diff --git a/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php b/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php index fe844c2..aeffa84 100644 --- a/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php +++ b/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php @@ -6,5 +6,5 @@ * Author: Automattic * Author URI: https://woocommerce.com/ * Requires WP: 5.6 - * Version: 7.5.0 + * Version: 7.6.0 */ diff --git a/woocommerce-subscriptions.php b/woocommerce-subscriptions.php index 64102f1..e9541b8 100644 --- a/woocommerce-subscriptions.php +++ b/woocommerce-subscriptions.php @@ -5,7 +5,7 @@ * Description: Sell products and services with recurring payments in your WooCommerce Store. * Author: WooCommerce * Author URI: https://woocommerce.com/ - * Version: 6.7.0 + * Version: 6.8.0 * Requires Plugins: woocommerce * * WC requires at least: 8.7.1 @@ -78,7 +78,7 @@ class WC_Subscriptions { public static $plugin_file = __FILE__; /** @var string */ - public static $version = '6.7.0'; // WRCS: DEFINED_VERSION. + public static $version = '6.8.0'; // WRCS: DEFINED_VERSION. /** @var string */ public static $wc_minimum_supported_version = '7.7';