diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 318c9b9b1..4cc6d3b41 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -12,7 +12,7 @@ jobs: - name: Check out the woocommerce-subscriptions-core repository uses: actions/checkout@v3 with: - ref: trunk + ref: ${{ github.ref }} path: main - name: Check out the woorelease repository diff --git a/changelog.txt b/changelog.txt index 48a3c1e69..0cf2e87d6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ *** WooCommerce Subscriptions Core Changelog *** += 7.7.2 - 2024-11-26 = +* Fix - Prevents notices being displayed on WordPress 6.7 due to loading translations too early. + = 7.7.1 - 2024-11-13 = * Fix - Only show the individual subscription information in customer notification emails, not all subscriptions purchased in the initial order. * Fix - Resolved issues with Customer Notification emails not being sent due to unsupported emoji used in the default email subject. diff --git a/includes/class-wc-subscriptions-core-plugin.php b/includes/class-wc-subscriptions-core-plugin.php index 3e6502c21..e35189a14 100644 --- a/includes/class-wc-subscriptions-core-plugin.php +++ b/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.7.1'; // WRCS: DEFINED_VERSION. + protected $library_version = '7.7.2'; // WRCS: DEFINED_VERSION. /** * The subscription scheduler instance. diff --git a/includes/data-stores/class-wcs-customer-store-cached-cpt.php b/includes/data-stores/class-wcs-customer-store-cached-cpt.php index 1ac9a27f8..6fcc220fa 100644 --- a/includes/data-stores/class-wcs-customer-store-cached-cpt.php +++ b/includes/data-stores/class-wcs-customer-store-cached-cpt.php @@ -70,13 +70,20 @@ protected function init() { $this->object_data_cache_manager->init(); + add_action( 'init', array( $this, 'register_debug_tools' ) ); + // When a user is first added, make sure the subscription cache is empty because it can not have any data yet, and we want to avoid running the query needlessly add_filter( 'user_register', array( $this, 'set_empty_cache' ) ); // When the post for a subscription is change, make sure the corresponding cache is updated add_action( 'wcs_update_post_meta_caches', array( $this, 'maybe_update_for_post_meta_change' ), 10, 5 ); add_action( 'wcs_delete_all_post_meta_caches', array( $this, 'maybe_delete_all_for_post_meta_change' ), 10, 1 ); + } + /** + * Register debug tools for managing the cache. + */ + public function register_debug_tools() { WCS_Debug_Tool_Factory::add_cache_tool( 'generator', __( 'Generate Customer Subscription Cache', 'woocommerce-subscriptions' ), __( 'This will generate the persistent cache for linking users with subscriptions. The caches will be generated overtime in the background (via Action Scheduler).', 'woocommerce-subscriptions' ), self::instance() ); WCS_Debug_Tool_Factory::add_cache_tool( 'eraser', __( 'Delete Customer Subscription Cache', 'woocommerce-subscriptions' ), __( 'This will clear the persistent cache of all of subscriptions stored against users in your store. Expect slower performance of checkout, renewal and other subscription related functions after taking this action. The caches will be regenerated overtime as queries to find a given user\'s subscriptions are run.', 'woocommerce-subscriptions' ), self::instance() ); } diff --git a/includes/data-stores/class-wcs-related-order-store-cached-cpt.php b/includes/data-stores/class-wcs-related-order-store-cached-cpt.php index ebf8e0d7e..dd994ef12 100644 --- a/includes/data-stores/class-wcs-related-order-store-cached-cpt.php +++ b/includes/data-stores/class-wcs-related-order-store-cached-cpt.php @@ -92,6 +92,8 @@ protected function init() { $this->object_data_cache_manager->init(); + add_action( 'init', array( $this, 'register_debug_tools' ) ); + // When a subscription is being read from the database, don't load cached related order meta data into subscriptions. add_filter( 'wcs_subscription_data_store_props_to_ignore', array( $this, 'add_related_order_cache_props' ), 10, 2 ); @@ -104,7 +106,12 @@ protected function init() { // When copying meta from a subscription to a renewal order, don't copy cache related order meta keys. add_filter( 'wc_subscriptions_renewal_order_data', array( $this, 'remove_related_order_cache_keys' ), 10, 1 ); + } + /** + * Register debug tools for managing the cache. + */ + public function register_debug_tools() { WCS_Debug_Tool_Factory::add_cache_tool( 'generator', __( 'Generate Related Order Cache', 'woocommerce-subscriptions' ), __( 'This will generate the persistent cache of all renewal, switch, resubscribe and other order types for all subscriptions in your store. The caches will be generated overtime in the background (via Action Scheduler).', 'woocommerce-subscriptions' ), self::instance() ); WCS_Debug_Tool_Factory::add_cache_tool( 'eraser', __( 'Delete Related Order Cache', 'woocommerce-subscriptions' ), __( 'This will clear the persistent cache of all renewal, switch, resubscribe and other order types for all subscriptions in your store. Expect slower performance of checkout, renewal and other subscription related functions after taking this action. The caches will be regenerated overtime as related order queries are run.', 'woocommerce-subscriptions' ), self::instance() ); } diff --git a/includes/privacy/class-wcs-privacy.php b/includes/privacy/class-wcs-privacy.php index 47d659ac8..d20b38129 100644 --- a/includes/privacy/class-wcs-privacy.php +++ b/includes/privacy/class-wcs-privacy.php @@ -37,7 +37,16 @@ public function __construct() { self::$background_process = new WCS_Privacy_Background_Updater(); } - parent::__construct( __( 'WooCommerce Subscriptions', 'woocommerce-subscriptions' ) ); + parent::__construct(); + + add_action( 'init', array( $this, 'register_erasers_exporters' ) ); + } + + /** + * Register erasers and exporters. + */ + public function register_erasers_exporters() { + $this->name = __( 'WooCommerce Subscriptions', 'woocommerce-subscriptions' ); // Add our exporters and erasers. $this->add_exporter( 'woocommerce-subscriptions-data', __( 'Subscriptions Data', 'woocommerce-subscriptions' ), array( 'WCS_Privacy_Exporters', 'subscription_data_exporter' ) ); diff --git a/includes/wcs-compatibility-functions.php b/includes/wcs-compatibility-functions.php index 2210e9ca6..1edebe777 100644 --- a/includes/wcs-compatibility-functions.php +++ b/includes/wcs-compatibility-functions.php @@ -603,11 +603,7 @@ function wcs_is_wc_feature_enabled( $feature_name ) { * @return bool */ function wcs_is_custom_order_tables_usage_enabled() { - if ( ! class_exists( '\Automattic\WooCommerce\Utilities\OrderUtil' ) || ! wcs_is_wc_feature_enabled( 'custom_order_tables' ) ) { - return false; - } - - return \Automattic\WooCommerce\Utilities\OrderUtil::custom_orders_table_usage_is_enabled(); + return class_exists( '\Automattic\WooCommerce\Utilities\OrderUtil' ) && \Automattic\WooCommerce\Utilities\OrderUtil::custom_orders_table_usage_is_enabled(); } /** diff --git a/package-lock.json b/package-lock.json index f4d8a2c29..cbf3b8c28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "woocommerce-subscriptions-core", - "version": "7.7.1", + "version": "7.7.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "woocommerce-subscriptions-core", - "version": "7.7.1", + "version": "7.7.2", "hasInstallScript": true, "license": "GPL-3.0-or-later", "dependencies": { diff --git a/package.json b/package.json index ab4f8d5dd..d2ac19d45 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "title": "WooCommerce Subscriptions Core", "author": "Automattic", "license": "GPL-3.0-or-later", - "version": "7.7.1", + "version": "7.7.2", "description": "", "homepage": "https://github.com/Automattic/woocommerce-subscriptions-core", "main": "Gruntfile.js", diff --git a/woocommerce-subscriptions-core.php b/woocommerce-subscriptions-core.php index 2a05303e6..0d9d40c0e 100644 --- a/woocommerce-subscriptions-core.php +++ b/woocommerce-subscriptions-core.php @@ -6,5 +6,5 @@ * Author: Automattic * Author URI: https://woocommerce.com/ * Requires WP: 5.6 - * Version: 7.7.1 + * Version: 7.7.2 */