Skip to content

Commit

Permalink
Updates to 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Woo committed Jun 13, 2024
1 parent 90575ce commit 4921e5e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
*** WooCommerce.com Update Manager Changelog ***

2024-06-10 - version 1.0.3
* Update - Declare compatibility with WooCommerce cart_checkout_blocks feature.
* Fix - Fix function name conflicts with other plugins.

2024-04-12 - version 1.0.2
* Update - Plugin name from Woo.com Update Manager to WooCommerce.com Update Manager.

Expand Down
9 changes: 6 additions & 3 deletions includes/class-woo-subscription-data-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
/**
* Updates the plugin details stored in transients used for auto-updates.
*
* @package Woo\Marketplace
* @package Automattic\WooUpdateManager
*/

namespace Automattic\WooUpdateManager;

defined( 'ABSPATH' ) || exit;

/**
Expand All @@ -17,6 +19,7 @@ class Woo_Subscription_Data_Updater {
*
* @return void
*/

public static function load() {
add_filter( 'update_woo_com_subscription_details', [ __CLASS__, 'update_plugin_package_url' ], 10, 3 );
}
Expand Down Expand Up @@ -53,8 +56,8 @@ public static function update_plugin_package_url( $item, $woo_subscription_data,
* @return bool True if active subscription found.
*/
public static function has_active_subscription( $product_id ) {
$auth = WC_Helper_Options::get( 'auth' );
$subscriptions = WC_Helper::get_subscriptions();
$auth = \WC_Helper_Options::get( 'auth' );
$subscriptions = \WC_Helper::get_subscriptions();

if ( empty( $auth['site_id'] ) || empty( $subscriptions ) ) {
return false;
Expand Down
13 changes: 8 additions & 5 deletions woo-update-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
* Woo: 18734003407318:e4367d0e8d424278fd7049e7d7b567a6
* Requires at least: 6.0
* Requires PHP: 7.3
* Version: 1.0.2
* Version: 1.0.3
*
* @package Woo\UpdateManager
*/

namespace Automattic\WooUpdateManager;

use Automattic\WooCommerce\Utilities\FeaturesUtil;

defined( 'ABSPATH' ) || exit;
Expand All @@ -35,21 +37,22 @@ function clear_update_transients() {
/**
* Register activation hook to clear update transients.
*/
register_activation_hook( __FILE__, 'clear_update_transients' );
register_activation_hook( __FILE__, __NAMESPACE__ . '\clear_update_transients' );

/**
* Register de-activation hook to clear update transients.
*/
register_deactivation_hook( __FILE__, 'clear_update_transients' );
register_deactivation_hook( __FILE__, __NAMESPACE__ . '\clear_update_transients' );


/**
* Declare compatibility for HPOS compatibility.
*/
function declare_hpos_compatibility() {
function declare_wc_feature_compatibility() {
if ( class_exists( FeaturesUtil::class ) ) {
FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, true );
}
}

add_action( 'before_woocommerce_init', 'declare_hpos_compatibility' );
add_action( 'before_woocommerce_init', __NAMESPACE__ . '\declare_wc_feature_compatibility' );

0 comments on commit 4921e5e

Please sign in to comment.