Skip to content

Commit

Permalink
Updates to 6.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WooCommerce committed Oct 14, 2024
1 parent ccb5fe3 commit b811acf
Show file tree
Hide file tree
Showing 18 changed files with 240 additions and 183 deletions.
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
18 changes: 18 additions & 0 deletions includes/payment-retry/admin/class-wcs-retry-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
}
}
Expand Down Expand Up @@ -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
*
Expand Down
194 changes: 100 additions & 94 deletions languages/woocommerce-subscriptions.pot

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit0a0744246f082255078926698437a7a5::getLoader();
return ComposerAutoloaderInit13fede8eb22b3733f757156a27f6ebe3::getLoader();
96 changes: 45 additions & 51 deletions vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,66 +45,63 @@ class ClassLoader
/** @var \Closure(string):void */
private static $includeFile;

/** @var ?string */
/** @var string|null */
private $vendorDir;

// PSR-4
/**
* @var array[]
* @psalm-var array<string, array<string, int>>
* @var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, array<int, string>>
* @var array<string, list<string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, string>
* @var list<string>
*/
private $fallbackDirsPsr4 = array();

// PSR-0
/**
* @var array[]
* @psalm-var array<string, array<string, string[]>>
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/
private $prefixesPsr0 = array();
/**
* @var array[]
* @psalm-var array<string, string>
* @var list<string>
*/
private $fallbackDirsPsr0 = array();

/** @var bool */
private $useIncludePath = false;

/**
* @var string[]
* @psalm-var array<string, string>
* @var array<string, string>
*/
private $classMap = array();

/** @var bool */
private $classMapAuthoritative = false;

/**
* @var bool[]
* @psalm-var array<string, bool>
* @var array<string, bool>
*/
private $missingClasses = array();

/** @var ?string */
/** @var string|null */
private $apcuPrefix;

/**
* @var self[]
* @var array<string, self>
*/
private static $registeredLoaders = array();

/**
* @param ?string $vendorDir
* @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
Expand All @@ -113,7 +110,7 @@ public function __construct($vendorDir = null)
}

/**
* @return string[]
* @return array<string, list<string>>
*/
public function getPrefixes()
{
Expand All @@ -125,44 +122,39 @@ public function getPrefixes()
}

/**
* @return array[]
* @psalm-return array<string, array<int, string>>
* @return array<string, list<string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}

/**
* @return array[]
* @psalm-return array<string, string>
* @return list<string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}

/**
* @return array[]
* @psalm-return array<string, string>
* @return list<string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}

/**
* @return string[] Array of classname => path
* @psalm-return array<string, string>
* @return array<string, string> Array of classname => path
*/
public function getClassMap()
{
return $this->classMap;
}

/**
* @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
* @param array<string, string> $classMap Class to filename map
*
* @return void
*/
Expand All @@ -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>|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
);
}

Expand All @@ -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
);
}
}
Expand All @@ -226,27 +219,28 @@ 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>|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
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])) {
Expand All @@ -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
);
}
}
Expand All @@ -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>|string $paths The PSR-0 base directories
*
* @return void
*/
Expand All @@ -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>|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
Expand Down Expand Up @@ -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<string, self>
*/
public static function getRegisteredLoaders()
{
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit0a0744246f082255078926698437a7a5
class ComposerAutoloaderInit13fede8eb22b3733f757156a27f6ebe3
{
private static $loader;

Expand All @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit0a0744246f082255078926698437a7a5
class ComposerStaticInit13fede8eb22b3733f757156a27f6ebe3
{
public static $prefixLengthsPsr4 = array (
'C' =>
Expand Down Expand Up @@ -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);
}
Expand Down
Loading

0 comments on commit b811acf

Please sign in to comment.