Skip to content

Commit

Permalink
Version 7.7.2 (#737)
Browse files Browse the repository at this point in the history
* Fixes notices being displayed on WordPress 6.7 due to loading translations too early. (#730)

* Remove unnecessary call to check if feature exists - fixes WP 6.7 compat

* Fix early translation calls in our privacy exporter/eraser class

* Register caching debug tools after init to fix translation issues

* Add changelog entry

* Update release PR workflow to use the selected branch instead of always using trunk

* Version 7.7.2

---------

Co-authored-by: Matt Allan <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 27, 2024
1 parent 07bf070 commit f4bce1c
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-subscriptions-core-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions includes/data-stores/class-wcs-customer-store-cached-cpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand All @@ -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() );
}
Expand Down
11 changes: 10 additions & 1 deletion includes/privacy/class-wcs-privacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
Expand Down
6 changes: 1 addition & 5 deletions includes/wcs-compatibility-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-subscriptions-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
* Author: Automattic
* Author URI: https://woocommerce.com/
* Requires WP: 5.6
* Version: 7.7.1
* Version: 7.7.2
*/

0 comments on commit f4bce1c

Please sign in to comment.