Updates to 6.6.0

This commit is contained in:
WooCommerce
2024-08-27 10:13:56 +00:00
parent a8df935923
commit ca6f1789c9
14 changed files with 171 additions and 106 deletions

View File

@@ -1,5 +1,9 @@
*** WooCommerce Subscriptions Changelog *** *** WooCommerce Subscriptions Changelog ***
2024-08-27 - version 6.6.1
* Fix: Resolved an issue where simple product prices were incorrectly set to $0 when purchasing subscriptions and simple products with a coupon in WC 9.2.
* Dev: Update subscriptions-core to 7.4.2.
2024-08-22 - version 6.6.0 2024-08-22 - version 6.6.0
* Fix: Resolve duplicate subscription creation and PHP warning when switching subscriptions with Prepaid for WooCommerce Subscriptions plugin active. * Fix: Resolve duplicate subscription creation and PHP warning when switching subscriptions with Prepaid for WooCommerce Subscriptions plugin active.
* Fix: Switch calculations now exclude previous switch orders with a checkout-draft status. * Fix: Switch calculations now exclude previous switch orders with a checkout-draft status.

View File

@@ -2,43 +2,38 @@
# This file is distributed under the same license as the WooCommerce Subscriptions plugin. # This file is distributed under the same license as the WooCommerce Subscriptions plugin.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WooCommerce Subscriptions 6.6.0\n" "Project-Id-Version: WooCommerce Subscriptions 6.6.1\n"
"Report-Msgid-Bugs-To: https://woocommerce.com/contact-us\n" "Report-Msgid-Bugs-To: https://woocommerce.com/contact-us\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-08-22T07:20:55+00:00\n" "POT-Creation-Date: 2024-08-27T01:02:31+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n" "X-Generator: WP-CLI 2.9.0\n"
"X-Domain: woocommerce-subscriptions\n" "X-Domain: woocommerce-subscriptions\n"
#. Plugin Name of the plugin #. Plugin Name of the plugin
#: woocommerce-subscriptions.php
#: vendor/woocommerce/subscriptions-core/includes/privacy/class-wcs-privacy.php:40 #: vendor/woocommerce/subscriptions-core/includes/privacy/class-wcs-privacy.php:40
msgid "WooCommerce Subscriptions" msgid "WooCommerce Subscriptions"
msgstr "" msgstr ""
#. Plugin URI of the plugin #. Plugin URI of the plugin
#: woocommerce-subscriptions.php
msgid "https://www.woocommerce.com/products/woocommerce-subscriptions/" msgid "https://www.woocommerce.com/products/woocommerce-subscriptions/"
msgstr "" msgstr ""
#. Description of the plugin #. Description of the plugin
#: woocommerce-subscriptions.php
msgid "Sell products and services with recurring payments in your WooCommerce Store." msgid "Sell products and services with recurring payments in your WooCommerce Store."
msgstr "" msgstr ""
#. Author of the plugin #. Author of the plugin
#: woocommerce-subscriptions.php
#: includes/admin/class-wcs-admin-reports.php:136 #: includes/admin/class-wcs-admin-reports.php:136
#: includes/admin/reports/class-wcs-report-cache-manager.php:262 #: includes/admin/reports/class-wcs-report-cache-manager.php:262
msgid "WooCommerce" msgid "WooCommerce"
msgstr "" msgstr ""
#. Author URI of the plugin #. Author URI of the plugin
#: woocommerce-subscriptions.php
msgid "https://woocommerce.com/" msgid "https://woocommerce.com/"
msgstr "" msgstr ""
@@ -2021,7 +2016,7 @@ msgid "Optionally include an amount to be charged at the outset of the subscript
msgstr "" msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/admin/class-wc-subscriptions-admin.php:374 #: vendor/woocommerce/subscriptions-core/includes/admin/class-wc-subscriptions-admin.php:374
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2422 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2479
#: vendor/woocommerce/subscriptions-core/templates/admin/html-variation-price.php:25 #: vendor/woocommerce/subscriptions-core/templates/admin/html-variation-price.php:25
msgid "Free trial" msgid "Free trial"
msgstr "" msgstr ""
@@ -3164,28 +3159,28 @@ msgid "Your cart has been emptied of subscription products. Only one subscriptio
msgstr "" msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart-validator.php:130 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart-validator.php:130
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:1482 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:1539
msgid "That subscription product can not be added to your cart as it already contains a subscription renewal." msgid "That subscription product can not be added to your cart as it already contains a subscription renewal."
msgstr "" msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:483 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:540
msgid "Initial Shipment" msgid "Initial Shipment"
msgstr "" msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:922 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:979
msgid "Please enter a valid postcode/ZIP." msgid "Please enter a valid postcode/ZIP."
msgstr "" msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:1120 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:1177
msgid "Invalid recurring shipping method." msgid "Invalid recurring shipping method."
msgstr "" msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2158 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2215
msgid "now" msgid "now"
msgstr "" msgstr ""
#. translators: placeholder is a number of days. #. translators: placeholder is a number of days.
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2317 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2374
#: vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php:58 #: vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php:58
msgid "%s day" msgid "%s day"
msgid_plural "%s days" msgid_plural "%s days"
@@ -3193,7 +3188,7 @@ msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#. translators: placeholder is a number of weeks. #. translators: placeholder is a number of weeks.
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2321 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2378
#: vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php:60 #: vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php:60
msgid "%s week" msgid "%s week"
msgid_plural "%s weeks" msgid_plural "%s weeks"
@@ -3201,7 +3196,7 @@ msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#. translators: placeholder is a number of months. #. translators: placeholder is a number of months.
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2325 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2382
#: vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php:62 #: vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php:62
msgid "%s month" msgid "%s month"
msgid_plural "%s months" msgid_plural "%s months"
@@ -3209,7 +3204,7 @@ msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#. translators: placeholder is a number of years. #. translators: placeholder is a number of years.
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2329 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2386
#: vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php:64 #: vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php:64
msgid "%s year" msgid "%s year"
msgid_plural "%s years" msgid_plural "%s years"
@@ -3217,49 +3212,49 @@ msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#. translators: 1$: day of the week (e.g. "every Wednesday"). #. translators: 1$: day of the week (e.g. "every Wednesday").
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2351 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2408
msgid "every %1$s" msgid "every %1$s"
msgstr "" msgstr ""
#. translators: 1$: period, 2$: day of the week (e.g. "every 2nd week on Wednesday"). #. translators: 1$: period, 2$: day of the week (e.g. "every 2nd week on Wednesday").
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2355 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2412
msgid "every %1$s on %2$s" msgid "every %1$s on %2$s"
msgstr "" msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2364 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2421
msgid "on the last day of each month" msgid "on the last day of each month"
msgstr "" msgstr ""
#. translators: 1$: day of the month (e.g. "23rd") (e.g. "every 23rd of each month"). #. translators: 1$: day of the month (e.g. "23rd") (e.g. "every 23rd of each month").
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2368 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2425
msgid "on the %1$s of each month" msgid "on the %1$s of each month"
msgstr "" msgstr ""
#. translators: 1$: interval (e.g. "3rd") (e.g. "on the last day of every 3rd month"). #. translators: 1$: interval (e.g. "3rd") (e.g. "on the last day of every 3rd month").
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2376 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2433
msgid "on the last day of every %1$s month" msgid "on the last day of every %1$s month"
msgstr "" msgstr ""
#. translators: on the, 1$: <date> day of every, 2$: <interval> month (e.g. "on the 23rd day of every 2nd month"). #. translators: on the, 1$: <date> day of every, 2$: <interval> month (e.g. "on the 23rd day of every 2nd month").
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2382 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2439
msgid "on the %1$s day of every %2$s month" msgid "on the %1$s day of every %2$s month"
msgstr "" msgstr ""
#. translators: on, 1$: <date>, 2$: <month> each year (e.g. "on March 15th each year"). #. translators: on, 1$: <date>, 2$: <month> each year (e.g. "on March 15th each year").
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2393 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2450
msgid "on %1$s %2$s each year" msgid "on %1$s %2$s each year"
msgstr "" msgstr ""
#. translators: 1$: month (e.g. "March"), 2$: day of the month (e.g. "23rd), 3$: interval year (r.g March 23rd every 2nd year"). #. translators: 1$: month (e.g. "March"), 2$: day of the month (e.g. "23rd), 3$: interval year (r.g March 23rd every 2nd year").
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2400 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2457
msgid "on %1$s %2$s every %3$s year" msgid "on %1$s %2$s every %3$s year"
msgstr "" msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2432 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2489
msgid "Sign up fee" msgid "Sign up fee"
msgstr "" msgstr ""
#: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2442 #: vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart.php:2499
msgid "Renews" msgid "Renews"
msgstr "" msgstr ""

2
vendor/autoload.php vendored
View File

@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit47c9a4f297bb3855920928bfaa252bb8::getLoader(); return ComposerAutoloaderInitd13119b632d3cc9554ea23819396f4c1::getLoader();

View File

@@ -45,34 +45,35 @@ class ClassLoader
/** @var \Closure(string):void */ /** @var \Closure(string):void */
private static $includeFile; private static $includeFile;
/** @var string|null */ /** @var ?string */
private $vendorDir; private $vendorDir;
// PSR-4 // PSR-4
/** /**
* @var array<string, array<string, int>> * @var array[]
* @psalm-var array<string, array<string, int>>
*/ */
private $prefixLengthsPsr4 = array(); private $prefixLengthsPsr4 = array();
/** /**
* @var array<string, list<string>> * @var array[]
* @psalm-var array<string, array<int, string>>
*/ */
private $prefixDirsPsr4 = array(); private $prefixDirsPsr4 = array();
/** /**
* @var list<string> * @var array[]
* @psalm-var array<string, string>
*/ */
private $fallbackDirsPsr4 = array(); private $fallbackDirsPsr4 = array();
// PSR-0 // PSR-0
/** /**
* List of PSR-0 prefixes * @var array[]
* * @psalm-var array<string, array<string, string[]>>
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/ */
private $prefixesPsr0 = array(); private $prefixesPsr0 = array();
/** /**
* @var list<string> * @var array[]
* @psalm-var array<string, string>
*/ */
private $fallbackDirsPsr0 = array(); private $fallbackDirsPsr0 = array();
@@ -80,7 +81,8 @@ class ClassLoader
private $useIncludePath = false; private $useIncludePath = false;
/** /**
* @var array<string, string> * @var string[]
* @psalm-var array<string, string>
*/ */
private $classMap = array(); private $classMap = array();
@@ -88,20 +90,21 @@ class ClassLoader
private $classMapAuthoritative = false; private $classMapAuthoritative = false;
/** /**
* @var array<string, bool> * @var bool[]
* @psalm-var array<string, bool>
*/ */
private $missingClasses = array(); private $missingClasses = array();
/** @var string|null */ /** @var ?string */
private $apcuPrefix; private $apcuPrefix;
/** /**
* @var array<string, self> * @var self[]
*/ */
private static $registeredLoaders = array(); private static $registeredLoaders = array();
/** /**
* @param string|null $vendorDir * @param ?string $vendorDir
*/ */
public function __construct($vendorDir = null) public function __construct($vendorDir = null)
{ {
@@ -110,7 +113,7 @@ class ClassLoader
} }
/** /**
* @return array<string, list<string>> * @return string[]
*/ */
public function getPrefixes() public function getPrefixes()
{ {
@@ -122,7 +125,8 @@ class ClassLoader
} }
/** /**
* @return array<string, list<string>> * @return array[]
* @psalm-return array<string, array<int, string>>
*/ */
public function getPrefixesPsr4() public function getPrefixesPsr4()
{ {
@@ -130,7 +134,8 @@ class ClassLoader
} }
/** /**
* @return list<string> * @return array[]
* @psalm-return array<string, string>
*/ */
public function getFallbackDirs() public function getFallbackDirs()
{ {
@@ -138,7 +143,8 @@ class ClassLoader
} }
/** /**
* @return list<string> * @return array[]
* @psalm-return array<string, string>
*/ */
public function getFallbackDirsPsr4() public function getFallbackDirsPsr4()
{ {
@@ -146,7 +152,8 @@ class ClassLoader
} }
/** /**
* @return array<string, string> Array of classname => path * @return string[] Array of classname => path
* @psalm-return array<string, string>
*/ */
public function getClassMap() public function getClassMap()
{ {
@@ -154,7 +161,8 @@ class ClassLoader
} }
/** /**
* @param array<string, string> $classMap Class to filename map * @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
* *
* @return void * @return void
*/ */
@@ -171,25 +179,24 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix, either * Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix. * appending or prepending to the ones previously set for this prefix.
* *
* @param string $prefix The prefix * @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 root directories * @param string[]|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories * @param bool $prepend Whether to prepend the directories
* *
* @return void * @return void
*/ */
public function add($prefix, $paths, $prepend = false) public function add($prefix, $paths, $prepend = false)
{ {
$paths = (array) $paths;
if (!$prefix) { if (!$prefix) {
if ($prepend) { if ($prepend) {
$this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0 = array_merge(
$paths, (array) $paths,
$this->fallbackDirsPsr0 $this->fallbackDirsPsr0
); );
} else { } else {
$this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0, $this->fallbackDirsPsr0,
$paths (array) $paths
); );
} }
@@ -198,19 +205,19 @@ class ClassLoader
$first = $prefix[0]; $first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) { if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = $paths; $this->prefixesPsr0[$first][$prefix] = (array) $paths;
return; return;
} }
if ($prepend) { if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix] = array_merge(
$paths, (array) $paths,
$this->prefixesPsr0[$first][$prefix] $this->prefixesPsr0[$first][$prefix]
); );
} else { } else {
$this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix], $this->prefixesPsr0[$first][$prefix],
$paths (array) $paths
); );
} }
} }
@@ -219,9 +226,9 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace, either * Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace. * appending or prepending to the ones previously set for this namespace.
* *
* @param string $prefix The prefix/namespace, with trailing '\\' * @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories * @param string[]|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories * @param bool $prepend Whether to prepend the directories
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* *
@@ -229,18 +236,17 @@ class ClassLoader
*/ */
public function addPsr4($prefix, $paths, $prepend = false) public function addPsr4($prefix, $paths, $prepend = false)
{ {
$paths = (array) $paths;
if (!$prefix) { if (!$prefix) {
// Register directories for the root namespace. // Register directories for the root namespace.
if ($prepend) { if ($prepend) {
$this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4 = array_merge(
$paths, (array) $paths,
$this->fallbackDirsPsr4 $this->fallbackDirsPsr4
); );
} else { } else {
$this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4, $this->fallbackDirsPsr4,
$paths (array) $paths
); );
} }
} elseif (!isset($this->prefixDirsPsr4[$prefix])) { } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
@@ -250,18 +256,18 @@ class ClassLoader
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
} }
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = $paths; $this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) { } elseif ($prepend) {
// Prepend directories for an already registered namespace. // Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix] = array_merge(
$paths, (array) $paths,
$this->prefixDirsPsr4[$prefix] $this->prefixDirsPsr4[$prefix]
); );
} else { } else {
// Append directories for an already registered namespace. // Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix], $this->prefixDirsPsr4[$prefix],
$paths (array) $paths
); );
} }
} }
@@ -270,8 +276,8 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix, * Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix. * replacing any others previously set for this prefix.
* *
* @param string $prefix The prefix * @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 base directories * @param string[]|string $paths The PSR-0 base directories
* *
* @return void * @return void
*/ */
@@ -288,8 +294,8 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace, * Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace. * replacing any others previously set for this namespace.
* *
* @param string $prefix The prefix/namespace, with trailing '\\' * @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories * @param string[]|string $paths The PSR-4 base directories
* *
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* *
@@ -475,9 +481,9 @@ class ClassLoader
} }
/** /**
* Returns the currently registered loaders keyed by their corresponding vendor directories. * Returns the currently registered loaders indexed by their corresponding vendor directories.
* *
* @return array<string, self> * @return self[]
*/ */
public static function getRegisteredLoaders() public static function getRegisteredLoaders()
{ {

View File

@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInit47c9a4f297bb3855920928bfaa252bb8 class ComposerAutoloaderInitd13119b632d3cc9554ea23819396f4c1
{ {
private static $loader; private static $loader;
@@ -24,12 +24,12 @@ class ComposerAutoloaderInit47c9a4f297bb3855920928bfaa252bb8
require __DIR__ . '/platform_check.php'; require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit47c9a4f297bb3855920928bfaa252bb8', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInitd13119b632d3cc9554ea23819396f4c1', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit47c9a4f297bb3855920928bfaa252bb8', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInitd13119b632d3cc9554ea23819396f4c1', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php'; require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit47c9a4f297bb3855920928bfaa252bb8::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInitd13119b632d3cc9554ea23819396f4c1::getInitializer($loader));
$loader->register(true); $loader->register(true);

View File

@@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInit47c9a4f297bb3855920928bfaa252bb8 class ComposerStaticInitd13119b632d3cc9554ea23819396f4c1
{ {
public static $prefixLengthsPsr4 = array ( public static $prefixLengthsPsr4 = array (
'C' => 'C' =>
@@ -129,9 +129,9 @@ class ComposerStaticInit47c9a4f297bb3855920928bfaa252bb8
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit47c9a4f297bb3855920928bfaa252bb8::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInitd13119b632d3cc9554ea23819396f4c1::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit47c9a4f297bb3855920928bfaa252bb8::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitd13119b632d3cc9554ea23819396f4c1::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit47c9a4f297bb3855920928bfaa252bb8::$classMap; $loader->classMap = ComposerStaticInitd13119b632d3cc9554ea23819396f4c1::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }

View File

@@ -156,17 +156,17 @@
}, },
{ {
"name": "woocommerce/subscriptions-core", "name": "woocommerce/subscriptions-core",
"version": "7.4.1", "version": "7.4.2",
"version_normalized": "7.4.1.0", "version_normalized": "7.4.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Automattic/woocommerce-subscriptions-core.git", "url": "https://github.com/Automattic/woocommerce-subscriptions-core.git",
"reference": "cfe4169e9c770baf4f3734c6e2baa9a014c023ba" "reference": "f42488f6e31d078759dc917056f2ab34f2790e43"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Automattic/woocommerce-subscriptions-core/zipball/cfe4169e9c770baf4f3734c6e2baa9a014c023ba", "url": "https://api.github.com/repos/Automattic/woocommerce-subscriptions-core/zipball/f42488f6e31d078759dc917056f2ab34f2790e43",
"reference": "cfe4169e9c770baf4f3734c6e2baa9a014c023ba", "reference": "f42488f6e31d078759dc917056f2ab34f2790e43",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -179,7 +179,7 @@
"woocommerce/woocommerce-sniffs": "0.1.0", "woocommerce/woocommerce-sniffs": "0.1.0",
"yoast/phpunit-polyfills": "1.1.0" "yoast/phpunit-polyfills": "1.1.0"
}, },
"time": "2024-08-21T09:17:35+00:00", "time": "2024-08-27T00:36:09+00:00",
"type": "wordpress-plugin", "type": "wordpress-plugin",
"extra": { "extra": {
"phpcodesniffer-search-depth": 2 "phpcodesniffer-search-depth": 2
@@ -209,7 +209,7 @@
"description": "Sell products and services with recurring payments in your WooCommerce Store.", "description": "Sell products and services with recurring payments in your WooCommerce Store.",
"homepage": "https://github.com/Automattic/woocommerce-subscriptions-core", "homepage": "https://github.com/Automattic/woocommerce-subscriptions-core",
"support": { "support": {
"source": "https://github.com/Automattic/woocommerce-subscriptions-core/tree/7.4.1", "source": "https://github.com/Automattic/woocommerce-subscriptions-core/tree/7.4.2",
"issues": "https://github.com/Automattic/woocommerce-subscriptions-core/issues" "issues": "https://github.com/Automattic/woocommerce-subscriptions-core/issues"
}, },
"install-path": "../woocommerce/subscriptions-core" "install-path": "../woocommerce/subscriptions-core"

View File

@@ -1,9 +1,9 @@
<?php return array( <?php return array(
'root' => array( 'root' => array(
'name' => 'woocommerce/woocommerce-subscriptions', 'name' => 'woocommerce/woocommerce-subscriptions',
'pretty_version' => 'dev-release/6.6.0', 'pretty_version' => 'dev-release/6.6.1',
'version' => 'dev-release/6.6.0', 'version' => 'dev-release/6.6.1',
'reference' => '0e08ee41671d4cc44c73224008901acd210d4686', 'reference' => '2c2bd10595b327e840fc5611433725df20bae33a',
'type' => 'wordpress-plugin', 'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@@ -32,18 +32,18 @@
), ),
), ),
'woocommerce/subscriptions-core' => array( 'woocommerce/subscriptions-core' => array(
'pretty_version' => '7.4.1', 'pretty_version' => '7.4.2',
'version' => '7.4.1.0', 'version' => '7.4.2.0',
'reference' => 'cfe4169e9c770baf4f3734c6e2baa9a014c023ba', 'reference' => 'f42488f6e31d078759dc917056f2ab34f2790e43',
'type' => 'wordpress-plugin', 'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../woocommerce/subscriptions-core', 'install_path' => __DIR__ . '/../woocommerce/subscriptions-core',
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'woocommerce/woocommerce-subscriptions' => array( 'woocommerce/woocommerce-subscriptions' => array(
'pretty_version' => 'dev-release/6.6.0', 'pretty_version' => 'dev-release/6.6.1',
'version' => 'dev-release/6.6.0', 'version' => 'dev-release/6.6.1',
'reference' => '0e08ee41671d4cc44c73224008901acd210d4686', 'reference' => '2c2bd10595b327e840fc5611433725df20bae33a',
'type' => 'wordpress-plugin', 'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),

View File

@@ -1,5 +1,8 @@
*** WooCommerce Subscriptions Core Changelog *** *** WooCommerce Subscriptions Core Changelog ***
= 7.4.2 - 2024-08-27 =
* Fix - Resolved an issue where simple product prices were incorrectly set to $0 when purchasing subscriptions and simple products with a coupon in WC 9.2.
= 7.4.1 - 2024-08-21 = = 7.4.1 - 2024-08-21 =
* Fix - Add a year to the next renewal date billing interval is 12 months or more for a synced subscription. * Fix - Add a year to the next renewal date billing interval is 12 months or more for a synced subscription.

View File

@@ -47,6 +47,16 @@ class WC_Subscriptions_Cart {
*/ */
private static $cached_recurring_cart = null; private static $cached_recurring_cart = null;
/**
* A stack of recurring cart keys being calculated.
*
* Before calculating a cart's totals, we set the recurring cart key and calculation type to match that cart's key and type. @see self::set_recurring_cart_key_before_calculate_totals()
* After a cart's totals have been calculated, we restore the recurring cart key and calculation type. @see self::update_recurring_cart_key_after_calculate_totals()
*
* @var array
*/
private static $recurring_totals_calculation_stack = [];
/** /**
* Bootstraps the class and hooks required actions & filters. * Bootstraps the class and hooks required actions & filters.
* *
@@ -113,6 +123,10 @@ class WC_Subscriptions_Cart {
// Redirect the user immediately to the checkout page after clicking "Sign Up Now" buttons to encourage immediate checkout // Redirect the user immediately to the checkout page after clicking "Sign Up Now" buttons to encourage immediate checkout
add_filter( 'woocommerce_add_to_cart_redirect', array( __CLASS__, 'add_to_cart_redirect' ) ); add_filter( 'woocommerce_add_to_cart_redirect', array( __CLASS__, 'add_to_cart_redirect' ) );
// Set the recurring cart being calculated.
add_action( 'woocommerce_before_calculate_totals', [ __CLASS__, 'set_recurring_cart_key_before_calculate_totals' ], 1 );
add_action( 'woocommerce_after_calculate_totals', [ __CLASS__, 'update_recurring_cart_key_after_calculate_totals' ], 1 );
} }
/** /**
@@ -226,6 +240,37 @@ class WC_Subscriptions_Cart {
return $price; return $price;
} }
/**
* Sets the recurring cart key and calculation type before calculating a carts totals.
*
* @param WC_Cart $cart The cart object being calculated.
*/
public static function set_recurring_cart_key_before_calculate_totals( $cart ) {
$recurring_cart_key = ! empty( $cart->recurring_cart_key ) ? $cart->recurring_cart_key : 'none';
// Store the recurring cart key in the stack.
array_unshift( self::$recurring_totals_calculation_stack, $recurring_cart_key );
// Set the current recurring cart key and calculation type.
self::set_recurring_cart_key( $recurring_cart_key );
self::set_calculation_type( 'none' === $recurring_cart_key ? 'none' : 'recurring_total' );
}
/**
* Updates the recurring cart key and calculation type after calculating a carts totals.
*
* @param WC_Cart $cart The cart object that finished calculating it's totals.
*/
public static function update_recurring_cart_key_after_calculate_totals( $cart ) {
// Remove the recurring cart key from the stack. It has finished calculating.
array_shift( self::$recurring_totals_calculation_stack );
$recurring_cart_key = empty( self::$recurring_totals_calculation_stack ) ? 'none' : reset( self::$recurring_totals_calculation_stack );
self::set_recurring_cart_key( $recurring_cart_key );
self::set_calculation_type( 'none' === $recurring_cart_key ? 'none' : 'recurring_total' );
}
/** /**
* Calculate the initial and recurring totals for all subscription products in the cart. * Calculate the initial and recurring totals for all subscription products in the cart.
* *
@@ -243,9 +288,21 @@ class WC_Subscriptions_Cart {
* @version 1.0.0 - Migrated from WooCommerce Subscriptions v2.0 * @version 1.0.0 - Migrated from WooCommerce Subscriptions v2.0
*/ */
public static function calculate_subscription_totals( $total, $cart ) { public static function calculate_subscription_totals( $total, $cart ) {
if ( ! self::cart_contains_subscription() && ! wcs_cart_contains_resubscribe() ) { // cart doesn't contain subscription // If the cart doesn't contain a subscription, skip calculating recurring totals.
if ( ! self::cart_contains_subscription() && ! wcs_cart_contains_resubscribe() ) {
return $total; return $total;
} elseif ( 'none' != self::$calculation_type ) { // We're in the middle of a recalculation, let it run }
// We're in the middle of a recalculation, let it run.
if ( 'none' !== self::$calculation_type ) {
return $total;
}
/**
* If we're in the middle of calculating recurring totals, skip this calculation to avoid infinite loops.
* We use whether there's a recurring cart key in the calculation stack (ie has started but hasn't finished) to determine if we're in the middle calculating recurring totals.
*/
if ( ! empty( array_diff( self::$recurring_totals_calculation_stack, [ 'none' ] ) ) ) {
return $total; return $total;
} }

View File

@@ -16,7 +16,7 @@ class WC_Subscriptions_Core_Plugin {
* The version of subscriptions-core library. * The version of subscriptions-core library.
* @var string * @var string
*/ */
protected $library_version = '7.4.1'; // WRCS: DEFINED_VERSION. protected $library_version = '7.4.2'; // WRCS: DEFINED_VERSION.
/** /**
* The subscription scheduler instance. * The subscription scheduler instance.

View File

@@ -46,7 +46,7 @@ class WCS_Limiter {
'class' => 'wc-enhanced-select', 'class' => 'wc-enhanced-select',
'label' => __( 'Limit subscription', 'woocommerce-subscriptions' ), 'label' => __( 'Limit subscription', 'woocommerce-subscriptions' ),
// translators: placeholders are opening and closing link tags // translators: placeholders are opening and closing link tags
'description' => sprintf( __( 'Only allow a customer to have one subscription to this product. %1$sLearn more%2$s.', 'woocommerce-subscriptions' ), '<a href="http://docs.woocommerce.com/document/subscriptions/store-manager-guide/#limit-subscription">', '</a>' ), 'description' => sprintf( __( 'Only allow a customer to have one subscription to this product. %1$sLearn more%2$s.', 'woocommerce-subscriptions' ), '<a href="https://woocommerce.com/document/subscriptions/creating-subscription-products/#limit-subscriptions">', '</a>' ),
'options' => array( 'options' => array(
'no' => __( 'Do not limit', 'woocommerce-subscriptions' ), 'no' => __( 'Do not limit', 'woocommerce-subscriptions' ),
'active' => __( 'Limit to one active subscription', 'woocommerce-subscriptions' ), 'active' => __( 'Limit to one active subscription', 'woocommerce-subscriptions' ),

View File

@@ -6,5 +6,5 @@
* Author: Automattic * Author: Automattic
* Author URI: https://woocommerce.com/ * Author URI: https://woocommerce.com/
* Requires WP: 5.6 * Requires WP: 5.6
* Version: 7.4.1 * Version: 7.4.2
*/ */

View File

@@ -5,11 +5,11 @@
* Description: Sell products and services with recurring payments in your WooCommerce Store. * Description: Sell products and services with recurring payments in your WooCommerce Store.
* Author: WooCommerce * Author: WooCommerce
* Author URI: https://woocommerce.com/ * Author URI: https://woocommerce.com/
* Version: 6.6.0 * Version: 6.6.1
* Requires Plugins: woocommerce * Requires Plugins: woocommerce
* *
* WC requires at least: 8.7.1 * WC requires at least: 8.7.1
* WC tested up to: 9.1.0 * WC tested up to: 9.2.0
* Woo: 27147:6115e6d7e297b623a169fdcf5728b224 * Woo: 27147:6115e6d7e297b623a169fdcf5728b224
* *
* Copyright 2019 WooCommerce * Copyright 2019 WooCommerce
@@ -78,7 +78,7 @@ class WC_Subscriptions {
public static $plugin_file = __FILE__; public static $plugin_file = __FILE__;
/** @var string */ /** @var string */
public static $version = '6.6.0'; // WRCS: DEFINED_VERSION. public static $version = '6.6.1'; // WRCS: DEFINED_VERSION.
/** @var string */ /** @var string */
public static $wc_minimum_supported_version = '7.7'; public static $wc_minimum_supported_version = '7.7';