mirror of
https://github.com/pronamic/woocommerce-subscriptions.git
synced 2025-10-07 01:54:05 +00:00
Updates to 6.3.1
This commit is contained in:
18
.wp-env.json
Normal file
18
.wp-env.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"plugins": [
|
||||
"https://downloads.wordpress.org/plugin/woocommerce.zip",
|
||||
"https://downloads.wordpress.org/plugin/email-log.zip",
|
||||
".",
|
||||
"./tests/e2e/test-configuration-plugin"
|
||||
],
|
||||
"themes": [
|
||||
"https://downloads.wordpress.org/theme/storefront.zip"
|
||||
],
|
||||
"env": {
|
||||
"tests": {
|
||||
"mappings": {
|
||||
"wp-cli.yml": "./tests/e2e/bin/wp-cli.yml"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,28 @@
|
||||
*** Woo Subscriptions Changelog ***
|
||||
*** WooCommerce Subscriptions Changelog ***
|
||||
|
||||
2024-05-09 - version 6.3.1
|
||||
* Fix: Resolved an issue that caused "WC_DateTime could not be converted to int" warnings to occur on non-hpos sites while editing a subscription.
|
||||
|
||||
2024-05-09 - version 6.3.0
|
||||
* Fix: Uncaught exception from 'WCS_Related_Order_Store_Cached_CPT::delete_relations' when order is not an instance of WC_Order.
|
||||
* Fix: Include subscription sign-up fees on orders created via the REST API.
|
||||
* Fix: Add check to prevent fatal error in rsort and array_sum.
|
||||
* Fix: Use `add_to_cart_ajax_redirect` instead of the deprecated `redirect_ajax_add_to_cart` function as callback.
|
||||
* Fix: Filtered order links in subscription reports returns all the orders when HPOS is enabled.
|
||||
* Fix: Typo in confirmation alert when users remove an item from a subscription.
|
||||
* Fix: Ensure the scheduled sale price for subscription products ends at the end of the "to" day set in product settings.
|
||||
* Fix: Subscription table is empty in mobile view when HPOS is enabled.
|
||||
* Fix: WooCommerce page header is hidden when HPOS is enabled.
|
||||
* Fix: Subscription updated messages missing on the Edit Subscription page when HPOS is enabled.
|
||||
* Fix: Resolved an issue that prevented bulk actions from running on the Subscriptions list table when the table was filtered by date, payment method, product or customer.
|
||||
* Fix: Subscriptions created via the POST `/wc/v3/orders/{order_id}/subscriptions` endpoint shouldn't include sign-up fees and/or $0 trial periods in line item totals.
|
||||
* Update: Update the shipping method styling to apply borders to the highlighted shipping option in the Checkout block.
|
||||
* Update: Include a full stack trace in failed scheduled action logs to improve troubleshooting issues.
|
||||
* Update: Show notice about product being removed from the cart when a subscription is for disabled mixed checkout setting.
|
||||
* Update: Change plugin name back to WooCommerce Subscriptions.
|
||||
* Dev: Calling wcs_create_subscription() will no longer attempt to fetch a fresh instance of the subscription at the end. This is to prevent loading the subscription from the database potentially unnecessarily.
|
||||
* Dev: Updated subscriptions-core to 7.1.0.
|
||||
* Dev: Bump WooCommerce minimum required version to 7.9.0.
|
||||
|
||||
2024-04-11 - version 6.2.0
|
||||
* Add: Declare WooCommerce as a plugin dependency in the plugin header.
|
||||
|
@@ -55,7 +55,7 @@ class WCS_Admin_Reports {
|
||||
$admin_notice->set_html_content(
|
||||
sprintf(
|
||||
'<p><strong>%s</strong></p><p>%s</p>',
|
||||
_x( 'Woo Subscriptions - Reports Not Available', 'heading used in an admin notice', 'woocommerce-subscriptions' ),
|
||||
_x( 'WooCommerce Subscriptions - Reports Not Available', 'heading used in an admin notice', 'woocommerce-subscriptions' ),
|
||||
sprintf(
|
||||
// translators: placeholders $1 and $2 are opening <a> tags linking to the WooCommerce documentation on HPOS and data synchronization. Placeholder $3 is a closing link (<a>) tag.
|
||||
__( 'Subscription reports are incompatible with the %1$sWooCommerce data storage features%3$s enabled on your store. Please enable %2$stable synchronization%3$s if you wish to use subscription reports.', 'woocommerce-subscriptions' ),
|
||||
|
@@ -624,6 +624,10 @@ class WC_REST_Subscriptions_Controller extends WC_REST_Orders_Controller {
|
||||
$subscription_item = $subscription->get_item( $item_id );
|
||||
|
||||
wcs_copy_order_item( $item, $subscription_item );
|
||||
|
||||
// Don't include sign-up fees or $0 trial periods when setting the subscriptions item totals.
|
||||
$this->maybe_set_recurring_item_total( $subscription_item );
|
||||
|
||||
$subscription_item->save();
|
||||
|
||||
// Check if this subscription will need shipping.
|
||||
@@ -684,8 +688,13 @@ class WC_REST_Subscriptions_Controller extends WC_REST_Orders_Controller {
|
||||
$subscription->add_item( $item );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Fetch a fresh instance of the subscription because the current instance has an empty line item cache generated before we had copied the line items.
|
||||
* Fetching a new instance will ensure the line items are used when calculating totals.
|
||||
*/
|
||||
$subscription = wcs_get_subscription( $subscription->get_id() );
|
||||
$subscription->calculate_totals();
|
||||
$subscription->save();
|
||||
|
||||
/**
|
||||
* Fires after a single subscription is created or updated via the REST API.
|
||||
@@ -709,4 +718,41 @@ class WC_REST_Subscriptions_Controller extends WC_REST_Orders_Controller {
|
||||
|
||||
return rest_ensure_response( $subscriptions );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the subscription item total to its recurring product price.
|
||||
*
|
||||
* This function ensures that sign-up fees and/or $0 trial periods are not carried over from the initial order to the subscription.
|
||||
* Note: If the line item has a custom total set by the merchant, don't override it with the recurring price.
|
||||
*
|
||||
* @param WC_Order_Item $item Subscription line item.
|
||||
*
|
||||
*/
|
||||
private function maybe_set_recurring_item_total( &$item ) {
|
||||
$product = $item->get_product();
|
||||
|
||||
if ( ! $product ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$sign_up_fee = WC_Subscriptions_Product::get_sign_up_fee( $product );
|
||||
$sign_up_fee = is_numeric( $sign_up_fee ) ? (float) $sign_up_fee : 0;
|
||||
$trial_length = WC_Subscriptions_Product::get_trial_length( $product );
|
||||
|
||||
$recurring_price = (float) $product->get_price();
|
||||
$initial_price = $trial_length > 0 ? $sign_up_fee : $recurring_price + $sign_up_fee;
|
||||
$initial_total = wc_get_price_excluding_tax( $product, [ 'qty' => $item->get_quantity(), 'price' => $initial_price ] );
|
||||
|
||||
// Check if a custom item total was set on the order. If so, don't override it.
|
||||
if ( (float) $item->get_subtotal() !== $initial_total ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$recurring_total = wc_get_price_excluding_tax( $product, [ 'qty' => $item->get_quantity(), 'price' => $recurring_price ] );
|
||||
|
||||
$item->set_props( [
|
||||
'subtotal' => $recurring_total,
|
||||
'total' => $recurring_total,
|
||||
] );
|
||||
}
|
||||
}
|
||||
|
@@ -153,10 +153,10 @@ class WC_Subscriptions_Dependency_Manager {
|
||||
);
|
||||
|
||||
// translators: 1$-2$: opening and closing <strong> tags, 3$-4$: link tags, takes to woocommerce plugin on wp.org, 5$-6$: opening and closing link tags, leads to plugins.php in admin
|
||||
$admin_notice_content = sprintf( esc_html__( '%1$sWoo Subscriptions is inactive.%2$s The %3$sWooCommerce plugin%4$s must be active for Woo Subscriptions to work. Please %5$sinstall & activate Woo »%6$s', 'woocommerce-subscriptions' ), '<strong>', '</strong>', '<a href="http://wordpress.org/extend/plugins/woocommerce/">', '</a>', '<a href="' . esc_url( $install_url ) . '">', '</a>' );
|
||||
$admin_notice_content = sprintf( esc_html__( '%1$sWooCommerce Subscriptions is inactive.%2$s The %3$sWooCommerce plugin%4$s must be active for WooCommerce Subscriptions to work. Please %5$sinstall & activate WooCommerce »%6$s', 'woocommerce-subscriptions' ), '<strong>', '</strong>', '<a href="http://wordpress.org/extend/plugins/woocommerce/">', '</a>', '<a href="' . esc_url( $install_url ) . '">', '</a>' );
|
||||
} elseif ( ! $this->is_woocommerce_version_supported() ) {
|
||||
// translators: 1$-2$: opening and closing <strong> tags, 3$: minimum supported WooCommerce version, 4$-5$: opening and closing link tags, leads to plugin admin
|
||||
$admin_notice_content = sprintf( esc_html__( '%1$sWoo Subscriptions is inactive.%2$s This version of Subscriptions requires WooCommerce %3$s or newer. Please %4$supdate WooCommerce to version %3$s or newer »%5$s', 'woocommerce-subscriptions' ), '<strong>', '</strong>', $this->minimum_supported_wc_version, '<a href="' . esc_url( admin_url( 'plugins.php' ) ) . '">', '</a>' );
|
||||
$admin_notice_content = sprintf( esc_html__( '%1$sWooCommerce Subscriptions is inactive.%2$s This version of Subscriptions requires WooCommerce %3$s or newer. Please %4$supdate WooCommerce to version %3$s or newer »%5$s', 'woocommerce-subscriptions' ), '<strong>', '</strong>', $this->minimum_supported_wc_version, '<a href="' . esc_url( admin_url( 'plugins.php' ) ) . '">', '</a>' );
|
||||
}
|
||||
|
||||
if ( $admin_notice_content ) {
|
||||
|
@@ -55,7 +55,7 @@ class WC_Subscriptions_Plugin extends WC_Subscriptions_Core_Plugin {
|
||||
$notice = new WCS_Admin_Notice( 'error' );
|
||||
|
||||
// translators: 1-2: opening/closing <b> tags, 3: Subscriptions version.
|
||||
$notice->set_simple_content( sprintf( __( '%1$sWarning!%2$s We can see the %1$sWooCommerce Subscriptions Early Renewal%2$s plugin is active. Version %3$s of %1$sWoo Subscriptions%2$s comes with that plugin\'s functionality packaged into the core plugin. Please deactivate WooCommerce Subscriptions Early Renewal to avoid any conflicts.', 'woocommerce-subscriptions' ), '<b>', '</b>', $this->get_plugin_version() ) ); // get_plugin_version() is used here to report the correct WCS version.
|
||||
$notice->set_simple_content( sprintf( __( '%1$sWarning!%2$s We can see the %1$sWooCommerce Subscriptions Early Renewal%2$s plugin is active. Version %3$s of %1$sWooCommerce Subscriptions%2$s comes with that plugin\'s functionality packaged into the core plugin. Please deactivate WooCommerce Subscriptions Early Renewal to avoid any conflicts.', 'woocommerce-subscriptions' ), '<b>', '</b>', $this->get_plugin_version() ) ); // get_plugin_version() is used here to report the correct WCS version.
|
||||
$notice->set_actions(
|
||||
array(
|
||||
array(
|
||||
@@ -202,7 +202,7 @@ class WC_Subscriptions_Plugin extends WC_Subscriptions_Core_Plugin {
|
||||
sprintf(
|
||||
// translators: $1-$2: opening and closing <strong> tags, $3-$4: opening and closing <em> tags.
|
||||
__(
|
||||
'%1$sWoo Subscriptions Installed%2$s – %3$sYou\'re ready to start selling subscriptions!%4$s',
|
||||
'%1$sWooCommerce Subscriptions Installed%2$s – %3$sYou\'re ready to start selling subscriptions!%4$s',
|
||||
'woocommerce-subscriptions'
|
||||
),
|
||||
'<strong>',
|
||||
|
@@ -18,6 +18,7 @@ class WCS_API {
|
||||
add_filter( 'woocommerce_api_classes', array( __CLASS__, 'includes' ) );
|
||||
add_action( 'rest_api_init', array( __CLASS__, 'register_routes' ), 15 );
|
||||
add_action( 'rest_api_init', array( __CLASS__, 'register_route_overrides' ), 15 );
|
||||
add_action( 'woocommerce_rest_set_order_item', [ __CLASS__, 'add_sign_up_fee_to_order_item' ], 15, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,6 +79,39 @@ class WCS_API {
|
||||
new WC_REST_Subscriptions_Settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds sign-up fees to order items added/edited via the REST API.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @param WC_Order_Item $item Order item object.
|
||||
*/
|
||||
public static function add_sign_up_fee_to_order_item( $item ) {
|
||||
if ( 'line_item' !== $item->get_type() || ! self::is_orders_api_request() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$product = $item->get_product();
|
||||
$sign_up_fee = WC_Subscriptions_Product::get_sign_up_fee( $product );
|
||||
$sign_up_fee = is_numeric( $sign_up_fee ) ? (float) $sign_up_fee : 0;
|
||||
|
||||
if ( 0 !== $sign_up_fee ) {
|
||||
// Recalculate the totals as in `prepare_line_items`, but including the sign up fee in the price.
|
||||
$trial_length = WC_Subscriptions_Product::get_trial_length( $product );
|
||||
|
||||
if ( $trial_length > 0 ) {
|
||||
$price = $sign_up_fee;
|
||||
} else {
|
||||
$price = (float) $product->get_price() + $sign_up_fee;
|
||||
}
|
||||
|
||||
$total = wc_get_price_excluding_tax( $product, [ 'qty' => $item->get_quantity(), 'price' => $price ] );
|
||||
|
||||
$item->set_total( $total );
|
||||
$item->set_subtotal( $total );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if a WP version compatible with REST API requests.
|
||||
*
|
||||
@@ -88,4 +122,19 @@ class WCS_API {
|
||||
global $wp_version;
|
||||
return version_compare( $wp_version, '4.4', '>=' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the current request is a REST API request for orders.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected static function is_orders_api_request() {
|
||||
if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST || empty( $GLOBALS['wp']->query_vars['rest_route'] ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (bool) preg_match( '/\/wc\/v[1-3]\/orders\b/', $GLOBALS['wp']->query_vars['rest_route'] );
|
||||
}
|
||||
}
|
||||
|
@@ -102,7 +102,7 @@ class WCS_Upgrade_Notice_Manager {
|
||||
);
|
||||
|
||||
// translators: placeholder is Subscription version string ('3.1')
|
||||
$notice->set_heading( sprintf( __( 'Welcome to Woo Subscriptions %s!', 'woocommerce-subscriptions' ), $version ) );
|
||||
$notice->set_heading( sprintf( __( 'Welcome to WooCommerce Subscriptions %s!', 'woocommerce-subscriptions' ), $version ) );
|
||||
$notice->set_content_template( 'update-welcome-notice.php', WC_Subscriptions_Core_Plugin::instance()->get_subscriptions_core_directory() . '/includes/upgrades/templates/', array(
|
||||
'version' => $version,
|
||||
'features' => $features,
|
||||
|
@@ -782,6 +782,10 @@ class WC_Subscriptions_Switcher {
|
||||
|
||||
$order = wc_get_order( $order_id );
|
||||
|
||||
if ( ! $order instanceof WC_Order ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// delete all the existing subscription switch links before adding new ones
|
||||
WCS_Related_Order_Store::instance()->delete_relations( $order, 'switch' );
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
20
vendor/autoload.php
vendored
20
vendor/autoload.php
vendored
@@ -2,24 +2,6 @@
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit270a670e4e35541a06419730c5cc18f6::getLoader();
|
||||
return ComposerAutoloaderInit8fb769e2bbbe11bb0307f5ba9e6722ef::getLoader();
|
||||
|
43
vendor/composer/ClassLoader.php
vendored
43
vendor/composer/ClassLoader.php
vendored
@@ -42,9 +42,6 @@ namespace Composer\Autoload;
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var ?string */
|
||||
private $vendorDir;
|
||||
|
||||
@@ -109,7 +106,6 @@ class ClassLoader
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -429,8 +425,7 @@ class ClassLoader
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -560,26 +555,18 @@ class ClassLoader
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
* @private
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
}
|
||||
|
31
vendor/composer/InstalledVersions.php
vendored
31
vendor/composer/InstalledVersions.php
vendored
@@ -28,7 +28,7 @@ class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
@@ -39,7 +39,7 @@ class InstalledVersions
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
@@ -98,7 +98,7 @@ class InstalledVersions
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class InstalledVersions
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
@@ -243,7 +243,7 @@ class InstalledVersions
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
@@ -257,7 +257,7 @@ class InstalledVersions
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@@ -280,7 +280,7 @@ class InstalledVersions
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
@@ -303,7 +303,7 @@ class InstalledVersions
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
@@ -313,7 +313,7 @@ class InstalledVersions
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
@@ -328,9 +328,7 @@ class InstalledVersions
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
@@ -342,17 +340,12 @@ class InstalledVersions
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
self::$installed = require __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
|
8
vendor/composer/autoload_real.php
vendored
8
vendor/composer/autoload_real.php
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit270a670e4e35541a06419730c5cc18f6
|
||||
class ComposerAutoloaderInit8fb769e2bbbe11bb0307f5ba9e6722ef
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@@ -24,12 +24,12 @@ class ComposerAutoloaderInit270a670e4e35541a06419730c5cc18f6
|
||||
|
||||
require __DIR__ . '/platform_check.php';
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit270a670e4e35541a06419730c5cc18f6', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit8fb769e2bbbe11bb0307f5ba9e6722ef', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit270a670e4e35541a06419730c5cc18f6', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit8fb769e2bbbe11bb0307f5ba9e6722ef', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit270a670e4e35541a06419730c5cc18f6::getInitializer($loader));
|
||||
\Composer\Autoload\ComposerStaticInit8fb769e2bbbe11bb0307f5ba9e6722ef::getInitializer($loader)();
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit270a670e4e35541a06419730c5cc18f6
|
||||
class ComposerStaticInit8fb769e2bbbe11bb0307f5ba9e6722ef
|
||||
{
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'C' =>
|
||||
@@ -129,9 +129,9 @@ class ComposerStaticInit270a670e4e35541a06419730c5cc18f6
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit270a670e4e35541a06419730c5cc18f6::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit270a670e4e35541a06419730c5cc18f6::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit270a670e4e35541a06419730c5cc18f6::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit8fb769e2bbbe11bb0307f5ba9e6722ef::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit8fb769e2bbbe11bb0307f5ba9e6722ef::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit8fb769e2bbbe11bb0307f5ba9e6722ef::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
14
vendor/composer/installed.json
vendored
14
vendor/composer/installed.json
vendored
@@ -156,17 +156,17 @@
|
||||
},
|
||||
{
|
||||
"name": "woocommerce/subscriptions-core",
|
||||
"version": "7.0.0",
|
||||
"version_normalized": "7.0.0.0",
|
||||
"version": "7.1.1",
|
||||
"version_normalized": "7.1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Automattic/woocommerce-subscriptions-core.git",
|
||||
"reference": "80a6cff950b4d43932382ebda2bad801b35af229"
|
||||
"reference": "5ba92addca2996576d39376907157243b061175e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Automattic/woocommerce-subscriptions-core/zipball/80a6cff950b4d43932382ebda2bad801b35af229",
|
||||
"reference": "80a6cff950b4d43932382ebda2bad801b35af229",
|
||||
"url": "https://api.github.com/repos/Automattic/woocommerce-subscriptions-core/zipball/5ba92addca2996576d39376907157243b061175e",
|
||||
"reference": "5ba92addca2996576d39376907157243b061175e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -179,7 +179,7 @@
|
||||
"woocommerce/woocommerce-sniffs": "0.1.0",
|
||||
"yoast/phpunit-polyfills": "1.1.0"
|
||||
},
|
||||
"time": "2024-04-11T01:44:20+00:00",
|
||||
"time": "2024-05-09T07:21:43+00:00",
|
||||
"type": "wordpress-plugin",
|
||||
"extra": {
|
||||
"phpcodesniffer-search-depth": 2
|
||||
@@ -209,7 +209,7 @@
|
||||
"description": "Sell products and services with recurring payments in your WooCommerce Store.",
|
||||
"homepage": "https://github.com/Automattic/woocommerce-subscriptions-core",
|
||||
"support": {
|
||||
"source": "https://github.com/Automattic/woocommerce-subscriptions-core/tree/7.0.0",
|
||||
"source": "https://github.com/Automattic/woocommerce-subscriptions-core/tree/7.1.1",
|
||||
"issues": "https://github.com/Automattic/woocommerce-subscriptions-core/issues"
|
||||
},
|
||||
"install-path": "../woocommerce/subscriptions-core"
|
||||
|
22
vendor/composer/installed.php
vendored
22
vendor/composer/installed.php
vendored
@@ -1,22 +1,22 @@
|
||||
<?php return array(
|
||||
'root' => array(
|
||||
'name' => 'woocommerce/woocommerce-subscriptions',
|
||||
'pretty_version' => 'dev-release/6.2.0',
|
||||
'version' => 'dev-release/6.2.0',
|
||||
'reference' => '6c5d3d921f40709889b3f583726869f2fa95877f',
|
||||
'pretty_version' => 'dev-release/6.3.1',
|
||||
'version' => 'dev-release/6.3.1',
|
||||
'type' => 'wordpress-plugin',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'reference' => 'b5a7272b9b055ce77d66fde677421f816ed0e83d',
|
||||
'name' => 'woocommerce/woocommerce-subscriptions',
|
||||
'dev' => false,
|
||||
),
|
||||
'versions' => array(
|
||||
'composer/installers' => array(
|
||||
'pretty_version' => 'v1.12.0',
|
||||
'version' => '1.12.0.0',
|
||||
'reference' => 'd20a64ed3c94748397ff5973488761b22f6d3f19',
|
||||
'type' => 'composer-plugin',
|
||||
'install_path' => __DIR__ . '/./installers',
|
||||
'aliases' => array(),
|
||||
'reference' => 'd20a64ed3c94748397ff5973488761b22f6d3f19',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'roundcube/plugin-installer' => array(
|
||||
@@ -32,21 +32,21 @@
|
||||
),
|
||||
),
|
||||
'woocommerce/subscriptions-core' => array(
|
||||
'pretty_version' => '7.0.0',
|
||||
'version' => '7.0.0.0',
|
||||
'reference' => '80a6cff950b4d43932382ebda2bad801b35af229',
|
||||
'pretty_version' => '7.1.1',
|
||||
'version' => '7.1.1.0',
|
||||
'type' => 'wordpress-plugin',
|
||||
'install_path' => __DIR__ . '/../woocommerce/subscriptions-core',
|
||||
'aliases' => array(),
|
||||
'reference' => '5ba92addca2996576d39376907157243b061175e',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'woocommerce/woocommerce-subscriptions' => array(
|
||||
'pretty_version' => 'dev-release/6.2.0',
|
||||
'version' => 'dev-release/6.2.0',
|
||||
'reference' => '6c5d3d921f40709889b3f583726869f2fa95877f',
|
||||
'pretty_version' => 'dev-release/6.3.1',
|
||||
'version' => 'dev-release/6.3.1',
|
||||
'type' => 'wordpress-plugin',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
'reference' => 'b5a7272b9b055ce77d66fde677421f816ed0e83d',
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
),
|
||||
|
@@ -46,7 +46,7 @@ var jstz = (function () {
|
||||
'Australia/Sydney': ['Australia/Lord_Howe'],
|
||||
'Asia/Tokyo': ['Asia/Yakutsk'],
|
||||
'Asia/Dhaka': ['Asia/Omsk'],
|
||||
// In the real world Yerevan is not ambigous for Baku... but Windows.
|
||||
// In the real world Yerevan is not ambiguous for Baku... but Windows.
|
||||
'Asia/Baku': ['Asia/Yerevan'],
|
||||
'Australia/Brisbane': ['Asia/Vladivostok'],
|
||||
'Pacific/Noumea': ['Asia/Vladivostok'],
|
||||
@@ -332,7 +332,7 @@ var jstz = (function () {
|
||||
* Builds up the current timezones DST rules for the years defined
|
||||
* in the jstz.olson.dst_rules.years array.
|
||||
*
|
||||
* If there are no DST occurences for those years, immediately returns
|
||||
* If there are no DST occurrences for those years, immediately returns
|
||||
* the preliminary timezone. Otherwise proceeds and tries to solve
|
||||
* ambiguities.
|
||||
*
|
||||
|
@@ -1 +1 @@
|
||||
<?php return array('dependencies' => array('wc-blocks-checkout', 'wc-price-format', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'b439c53b9fc89572bb98cb7ea362b3e0');
|
||||
<?php return array('dependencies' => array('wc-blocks-checkout', 'wc-price-format', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'b74144542a686437daa06d7e57f2567f');
|
@@ -14,7 +14,7 @@ Object(l.__)("Recurring total every 2nd %1$s","woocommerce-subscriptions"),n);ca
|
||||
/* Translators: %1$s is week, month, year */
|
||||
Object(l.__)("Recurring total every 3rd %1$s","woocommerce-subscriptions"),n);default:return Object(l.sprintf)(
|
||||
/* Translators: %1$d is number of weeks, months, days, years. %2$s is week, month, year */
|
||||
Object(l.__)("Recurring total every %1$dth %2$s","woocommerce-subscriptions"),t,n)}}({billingInterval:n,billingPeriod:c});return Object(r.createElement)(i.TotalsItem,{className:"wcs-recurring-totals-panel__title",currency:t,label:u,value:a,description:Object(r.createElement)(f,{nextPaymentDate:o,subscriptionLength:s,billingInterval:n,billingPeriod:c})})},j=function(e){var t,n,c,o=e.subscription,s=e.needsShipping,u=e.calculatedShipping,p=o.totals,b=o.billing_interval,m=o.billing_period,f=o.next_payment_date,j=o.subscription_length,w=o.shipping_rates;if(!f)return null;var v=null==w||null===(t=w[0])||void 0===t||null===(n=t.shipping_rates)||void 0===n||null===(c=n.find((function(e){return e.selected})))||void 0===c?void 0:c.name,y=Object(a.getCurrencyFromPriceResponse)(p);return Object(r.createElement)("div",{className:"wcs-recurring-totals-panel"},Object(r.createElement)(O,{billingInterval:b,billingPeriod:m,nextPaymentDate:f,subscriptionLength:j,totals:parseInt(p.total_price,10),currency:y}),Object(r.createElement)(i.Panel,{className:"wcs-recurring-totals-panel__details",initialOpen:!1,title:Object(l.__)("Details","woocommerce-subscriptions")},Object(r.createElement)(i.TotalsWrapper,null,Object(r.createElement)(i.Subtotal,{currency:y,values:p}),Object(r.createElement)(d,{currency:y,values:p})),Object(r.createElement)(i.TotalsWrapper,null,Object(r.createElement)(_,{currency:y,needsShipping:s,calculatedShipping:u,values:p,selectedRate:v})),!g&&Object(r.createElement)(i.TotalsWrapper,null,Object(r.createElement)(i.TotalsTaxes,{currency:y,values:p})),Object(r.createElement)(i.TotalsWrapper,null,Object(r.createElement)(i.TotalsItem,{className:"wcs-recurring-totals-panel__details-total",currency:y,label:Object(l.__)("Total","woocommerce-subscriptions"),value:parseInt(p.total_price,10)}))))},w=function(e){var t=e.extensions,n=e.cart,c=t.subscriptions,i=n.cartNeedsShipping,o=n.cartHasCalculatedShipping;return c&&0!==c.length?c.map((function(e){var t=e.key,n=s()(e,["key"]);return Object(r.createElement)(j,{subscription:n,needsShipping:i,calculatedShipping:o,key:t})})):null},v=function(e){var t=e.extensions,n=e.collapsible,c=e.collapse,i=e.showItems,o=e.noResultsMessage,l=e.renderOption,a=e.components,u=t.subscriptions,p=void 0===u?[]:u,b=a.ShippingRatesControlPackage,m=Object(r.useMemo)((function(){return Object.values(p).map((function(e){return e.shipping_rates})).filter(Boolean).flat()}),[p]),g=Object(r.useMemo)((function(){return 1<m.length||c}),[m.length,c]),d=Object(r.useMemo)((function(){return 1<m.length||i}),[m.length,i]);return m.map((function(e){var t=e.package_id,c=s()(e,["package_id"]);return Object(r.createElement)(b,{key:t,packageId:t,packageData:c,collapsible:n,collapse:g,showItems:d,noResultsMessage:o,renderOption:l})}))};n(9),Object(c.registerPlugin)("woocommerce-subscriptions",{render:function(){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.ExperimentalOrderShippingPackages,null,Object(r.createElement)(v,null)),Object(r.createElement)(i.ExperimentalOrderMeta,null,Object(r.createElement)(w,null)))},scope:"woocommerce-checkout"}),Object(i.registerCheckoutFilters)("woocommerce-subscriptions",{totalLabel:function(e,t){var n=t.subscriptions;return 0<(null==n?void 0:n.length)?Object(l.__)("Total due today","woocommerce-subscriptions"):e},subtotalPriceFormat:function(e,t){var n=t.subscriptions;if(null!=n&&n.billing_period&&null!=n&&n.billing_interval){var r=n.billing_interval,c=n.subscription_length;return m({subscriptionLength:c,billingInterval:r})?b(n,1===c?// translators: the word used to describe billing frequency, e.g. "fo1" 1 day or "for" 1 month.
|
||||
Object(l.__)("Recurring total every %1$dth %2$s","woocommerce-subscriptions"),t,n)}}({billingInterval:n,billingPeriod:c});return Object(r.createElement)(i.TotalsItem,{className:"wcs-recurring-totals-panel__title",currency:t,label:u,value:a,description:Object(r.createElement)(f,{nextPaymentDate:o,subscriptionLength:s,billingInterval:n,billingPeriod:c})})},j=function(e){var t,n,c,o=e.subscription,s=e.needsShipping,u=e.calculatedShipping,p=o.totals,b=o.billing_interval,m=o.billing_period,f=o.next_payment_date,j=o.subscription_length,w=o.shipping_rates;if(!f)return null;var v=null==w||null===(t=w[0])||void 0===t||null===(n=t.shipping_rates)||void 0===n||null===(c=n.find((function(e){return e.selected})))||void 0===c?void 0:c.name,y=Object(a.getCurrencyFromPriceResponse)(p);return Object(r.createElement)("div",{className:"wcs-recurring-totals-panel"},Object(r.createElement)(O,{billingInterval:b,billingPeriod:m,nextPaymentDate:f,subscriptionLength:j,totals:parseInt(p.total_price,10),currency:y}),Object(r.createElement)(i.Panel,{className:"wcs-recurring-totals-panel__details",initialOpen:!1,title:Object(l.__)("Details","woocommerce-subscriptions")},Object(r.createElement)(i.TotalsWrapper,null,Object(r.createElement)(i.Subtotal,{currency:y,values:p}),Object(r.createElement)(d,{currency:y,values:p})),Object(r.createElement)(i.TotalsWrapper,null,Object(r.createElement)(_,{currency:y,needsShipping:s,calculatedShipping:u,values:p,selectedRate:v})),!g&&Object(r.createElement)(i.TotalsWrapper,null,Object(r.createElement)(i.TotalsTaxes,{currency:y,values:p})),Object(r.createElement)(i.TotalsWrapper,null,Object(r.createElement)(i.TotalsItem,{className:"wcs-recurring-totals-panel__details-total",currency:y,label:Object(l.__)("Total","woocommerce-subscriptions"),value:parseInt(p.total_price,10)}))))},w=function(e){var t=e.extensions,n=e.cart,c=t.subscriptions,i=n.cartNeedsShipping,o=n.cartHasCalculatedShipping;return c&&0!==c.length?c.map((function(e){var t=e.key,n=s()(e,["key"]);return Object(r.createElement)(j,{subscription:n,needsShipping:i,calculatedShipping:o,key:t})})):null},v=function(e){var t=e.extensions,n=e.collapsible,c=e.collapse,i=e.showItems,o=e.noResultsMessage,l=e.renderOption,a=e.components,u=e.context,p=t.subscriptions,b=void 0===p?[]:p,m=a.ShippingRatesControlPackage,g=Object(r.useMemo)((function(){return Object.values(b).map((function(e){return e.shipping_rates})).filter(Boolean).flat()}),[b]),d=Object(r.useMemo)((function(){return 1<g.length||c}),[g.length,c]),_=Object(r.useMemo)((function(){return 1<g.length||i}),[g.length,i]);return g.map((function(e){var t=e.package_id,c=s()(e,["package_id"]);return Object(r.createElement)(m,{key:t,packageId:t,packageData:c,collapsible:n,collapse:d,showItems:_,noResultsMessage:o,renderOption:l,highlightChecked:"woocommerce/checkout"===u})}))};n(9),Object(c.registerPlugin)("woocommerce-subscriptions",{render:function(){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.ExperimentalOrderShippingPackages,null,Object(r.createElement)(v,null)),Object(r.createElement)(i.ExperimentalOrderMeta,null,Object(r.createElement)(w,null)))},scope:"woocommerce-checkout"}),Object(i.registerCheckoutFilters)("woocommerce-subscriptions",{totalLabel:function(e,t){var n=t.subscriptions;return 0<(null==n?void 0:n.length)?Object(l.__)("Total due today","woocommerce-subscriptions"):e},subtotalPriceFormat:function(e,t){var n=t.subscriptions;if(null!=n&&n.billing_period&&null!=n&&n.billing_interval){var r=n.billing_interval,c=n.subscription_length;return m({subscriptionLength:c,billingInterval:r})?b(n,1===c?// translators: the word used to describe billing frequency, e.g. "for" 1 day or "for" 1 month.
|
||||
Object(l.__)("for 1","woocommerce-subscriptions"):// translators: the word used to describe billing frequency, e.g. "for" 6 days or "for" 2 weeks.
|
||||
Object(l.__)("for","woocommerce-subscriptions"),e):b(n,// translators: the word used to describe billing frequency, e.g. "every" 6 days or "every" 2 weeks.
|
||||
Object(l.__)("every","woocommerce-subscriptions"),e)}return e},saleBadgePriceFormat:function(e,t){var n=t.subscriptions;return null!=n&&n.billing_period&&null!=n&&n.billing_interval?b(n,"/",e):e},itemName:function(e,t){var n=t.subscriptions;return null!=n&&n.is_resubscribe?Object(l.sprintf)(// translators: %s Product name.
|
||||
|
@@ -1,5 +1,23 @@
|
||||
*** WooCommerce Subscriptions Core Changelog ***
|
||||
|
||||
= 7.1.1 - 2024-05-09 =
|
||||
* Fix - Resolved an issue that caused "WC_DateTime could not be converted to int" warnings to occur on non-hpos sites while editing a subscription.
|
||||
|
||||
= 7.1.0 - 2024-05-09 =
|
||||
* Fix - Add check to prevent fatal error in rsort and array_sum.
|
||||
* Fix - Use `add_to_cart_ajax_redirect` instead of the deprecated `redirect_ajax_add_to_cart` function as callback.
|
||||
* Fix - Filtered order links in subscription reports returns all the orders when HPOS is enabled.
|
||||
* Fix - Typo in confirmation alert when users remove an item from a subscription.
|
||||
* Fix - Ensure the scheduled sale price for subscription products ends at the end of the "to" day set in product settings.
|
||||
* Fix - Subscription table is empty in mobile view when HPOS is enabled.
|
||||
* Fix - WooCommerce page header is hidden when HPOS is enabled.
|
||||
* Fix - Subscription updated messages missing on the Edit Subscription page when HPOS is enabled.
|
||||
* Fix - Resolved an issue that prevented bulk actions from running on the Subscriptions list table when the table was filtered by date, payment method, product or customer.
|
||||
* Update - Update the shipping method styling to apply borders to the highlighted shipping option in the Checkout block.
|
||||
* Update - Include a full stack trace in failed scheduled action logs to improve troubleshooting issues.
|
||||
* Update - Show notice about product being removed from the cart when a subscription is for disabled mixed checkout setting.
|
||||
* Dev - Calling wcs_create_subscription() will no longer attempt to fetch a fresh instance of the subscription at the end. This is to prevent loading the subscription from the database potentially unnecessarily.
|
||||
|
||||
= 7.0.0 - 2024-04-11 =
|
||||
* Fix - Update the failing payment method on a subscription when customers successfully pay for a failed renewal order via the block checkout.
|
||||
* Fix - Resolved an issue that would cause subscriptions to be directly cancelled by the WooCommerce process of automatically cancelling unpaid orders in-line with the hold stock setting.
|
||||
@@ -45,7 +63,7 @@
|
||||
* Fix - When a subscription is flagged as requiring manual payments, allow admin users to turn on automatic payments for a subscription via the Edit Subscription page by selecting a new payment method.
|
||||
* Fix - When processing an early renewal order, make sure the suspension count is reset back to 0 on payment complete.
|
||||
* Fix - Ensure proper backfilling of subscription metadata (i.e. dates and cache) to the postmeta table when HPOS is enabled and compatibility mode (data syncing) is turned on.
|
||||
* Fix - Fetch and update the `_cancelled_email_sent` meta in a HPOS compatibile way.
|
||||
* Fix - Fetch and update the `_cancelled_email_sent` meta in a HPOS compatible way.
|
||||
* Dev - Introduce a new wcs_get_subscription_grouping_key() function to generate a unique key for a subscription based on its billing schedule. This function uses the existing recurring cart key concept.
|
||||
* Dev - Deprecate the WC_Subscriptions_Synchroniser::add_to_recurring_cart_key(). Use WC_Subscriptions_Synchroniser::add_to_recurring_product_grouping_key() instead.
|
||||
|
||||
|
@@ -89,7 +89,7 @@ abstract class WCS_Background_Updater {
|
||||
*
|
||||
* Importantly, the overlap between the next scheduled update and the current batch is also useful for running
|
||||
* Action Scheduler via WP CLI, because it will allow for continuous execution of updates (i.e. updating a new
|
||||
* batch as soon as one batch has execeeded the time limit rather than having to run Action Scheduler via WP CLI
|
||||
* batch as soon as one batch has exceeded the time limit rather than having to run Action Scheduler via WP CLI
|
||||
* again later).
|
||||
*/
|
||||
public function run_update() {
|
||||
|
@@ -119,6 +119,9 @@ class WC_Subscriptions_Admin {
|
||||
add_filter( 'posts_where', array( __CLASS__, 'filter_orders_and_subscriptions_from_list' ) );
|
||||
add_filter( 'posts_where', array( __CLASS__, 'filter_paid_subscription_orders_for_user' ) );
|
||||
|
||||
// Filter Order and Subscriptions used by Subscription Reports.
|
||||
add_filter( 'woocommerce_orders_table_query_clauses', array( __CLASS__, 'filter_orders_and_subscriptions_from_order_table' ) );
|
||||
|
||||
add_action( 'admin_notices', __CLASS__ . '::display_renewal_filter_notice' );
|
||||
|
||||
add_shortcode( 'subscriptions', __CLASS__ . '::do_subscriptions_shortcode' );
|
||||
@@ -509,11 +512,11 @@ class WC_Subscriptions_Admin {
|
||||
update_post_meta( $post_id, '_regular_price', $subscription_price );
|
||||
update_post_meta( $post_id, '_sale_price', $sale_price );
|
||||
|
||||
$site_offset = get_option( 'gmt_offset' ) * 3600;
|
||||
$site_offset = wc_timezone_offset();
|
||||
|
||||
// Save the timestamps in UTC time, the way WC does it.
|
||||
$date_from = ( ! empty( $_POST['_sale_price_dates_from'] ) ) ? wcs_date_to_time( $_POST['_sale_price_dates_from'] ) - $site_offset : '';
|
||||
$date_to = ( ! empty( $_POST['_sale_price_dates_to'] ) ) ? wcs_date_to_time( $_POST['_sale_price_dates_to'] ) - $site_offset : '';
|
||||
// Fetch the timestamps in UTC time to check if the product is currently on sale.
|
||||
$date_from = ! empty( $_POST['_sale_price_dates_from'] ) ? wcs_date_to_time( gmdate( 'Y-m-d 00:00:00', wcs_strtotime_dark_knight( wc_clean( wp_unslash( $_POST['_sale_price_dates_from'] ) ) ) ) ) - $site_offset : '';
|
||||
$date_to = ! empty( $_POST['_sale_price_dates_to'] ) ? wcs_date_to_time( gmdate( 'Y-m-d 23:59:59', wcs_strtotime_dark_knight( wc_clean( wp_unslash( $_POST['_sale_price_dates_to'] ) ) ) ) ) - $site_offset : '';
|
||||
|
||||
$now = gmdate( 'U' );
|
||||
|
||||
@@ -521,9 +524,6 @@ class WC_Subscriptions_Admin {
|
||||
$date_from = $now;
|
||||
}
|
||||
|
||||
update_post_meta( $post_id, '_sale_price_dates_from', $date_from );
|
||||
update_post_meta( $post_id, '_sale_price_dates_to', $date_to );
|
||||
|
||||
// Update price if on sale
|
||||
if ( '' !== $sale_price && ( ( empty( $date_to ) && empty( $date_from ) ) || ( $date_from < $now && ( empty( $date_to ) || $date_to > $now ) ) ) ) {
|
||||
$price = $sale_price;
|
||||
@@ -1387,6 +1387,86 @@ class WC_Subscriptions_Admin {
|
||||
return $query_vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the Admin orders and subscriptions table results in HPOS based on a list of IDs returned by a report query.
|
||||
*
|
||||
* @since 7.1.0
|
||||
*
|
||||
* @param array $clauses The query clause.
|
||||
*
|
||||
* @return array $clauses The query clause with additional `where` clause .
|
||||
*/
|
||||
public static function filter_orders_and_subscriptions_from_order_table( $clauses ) {
|
||||
global $wpdb;
|
||||
|
||||
$query_vars = [
|
||||
'page' => '',
|
||||
'_report' => '',
|
||||
'_orders_list_key' => '',
|
||||
'_subscriptions_list_key' => '',
|
||||
'_data_key' => '',
|
||||
];
|
||||
|
||||
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||
// Map and sanitize $_GET vars to $query_vars.
|
||||
foreach ( array_keys( $query_vars ) as $var ) {
|
||||
if ( isset( $_GET[ $var ] ) ) {
|
||||
$query_vars[ $var ] = sanitize_text_field( wp_unslash( $_GET[ $var ] ) );
|
||||
}
|
||||
}
|
||||
// phpcs:enable WordPress.Security.NonceVerification.Recommended
|
||||
|
||||
if ( ! ( ! empty( $query_vars['page'] ) && in_array( $query_vars['page'], [ 'wc-orders', 'wc-orders--shop_subscription' ], true ) ) || empty( $query_vars['_report'] ) ) {
|
||||
return $clauses;
|
||||
}
|
||||
|
||||
// Map the order or subscription type to their respective keys and type key.
|
||||
$object_type = ! empty( $query_vars['_orders_list_key'] ) ? 'order' : ( ! empty( $query_vars['_subscriptions_list_key'] ) ? 'subscription' : '' );
|
||||
$cache_report_key = ! empty( $query_vars[ "_{$object_type}s_list_key" ] ) ? $query_vars[ "_{$object_type}s_list_key" ] : '';
|
||||
|
||||
// If the report key or report arg is empty exit early.
|
||||
if ( empty( $cache_report_key ) || empty( $query_vars['_report'] ) ) {
|
||||
$clauses['where'] .= " AND {$wpdb->posts}.ID = 0";
|
||||
return $clauses;
|
||||
}
|
||||
|
||||
$cache = get_transient( $query_vars['_report'] );
|
||||
|
||||
// Display an admin notice if we cannot find the report data requested.
|
||||
if ( ! isset( $cache[ $cache_report_key ] ) ) {
|
||||
$admin_notice = new WCS_Admin_Notice( 'error' );
|
||||
$admin_notice->set_simple_content(
|
||||
sprintf(
|
||||
/* translators: Placeholders are opening and closing link tags. */
|
||||
__( 'We weren\'t able to locate the set of report results you requested. Please regenerate the link from the %1$sSubscription Reports screen%2$s.', 'woocommerce-subscriptions' ),
|
||||
'<a href="' . esc_url( admin_url( 'admin.php?page=wc-reports&tab=subscriptions&report=subscription_events_by_date' ) ) . '">',
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
$admin_notice->display();
|
||||
|
||||
$clauses['where'] .= " AND {$wpdb->posts}.ID = 0";
|
||||
wc_get_logger()->warning( 'returning 2 $clauses-- ' . wp_json_encode( $clauses ) );
|
||||
|
||||
return $clauses;
|
||||
}
|
||||
|
||||
$results = $cache[ $cache_report_key ];
|
||||
|
||||
// The current subscriptions count report will include the specific result (the subscriptions active on the last day) that should be used to generate the subscription list.
|
||||
if ( ! empty( $query_vars['_data_key'] ) && isset( $results[ (int) $query_vars['_data_key'] ] ) ) {
|
||||
$results = array( $results[ (int) $query_vars['_data_key'] ] );
|
||||
}
|
||||
|
||||
$ids = explode( ',', implode( ',', wp_list_pluck( $results, "{$object_type}_ids", true ) ) );
|
||||
$format = implode( ', ', array_fill( 0, count( $ids ), '%d' ) );
|
||||
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
|
||||
$clauses['where'] .= $wpdb->prepare( " AND {$wpdb->prefix}wc_orders.ID IN ($format)", $ids );
|
||||
|
||||
return $clauses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the Admin orders and subscriptions table results based on a list of IDs returned by a report query.
|
||||
*
|
||||
@@ -1910,7 +1990,7 @@ class WC_Subscriptions_Admin {
|
||||
* @param string $insert_after_setting_id The setting id to insert the new setting after.
|
||||
* @param array $new_setting The new setting to insert. Can be a single setting or an array of settings.
|
||||
* @param string $insert_type The type of insert to perform. Can be 'single_setting' or 'multiple_settings'. Optional. Defaults to a single setting insert.
|
||||
* @param string $insert_after The setting type to insert the new settings after. Optional. Default is 'first' - the setting will be inserted after the first occuring setting with the matching ID (no specific type). Pass a setting type (like 'sectionend') to insert after a setting type.
|
||||
* @param string $insert_after The setting type to insert the new settings after. Optional. Default is 'first' - the setting will be inserted after the first occurring setting with the matching ID (no specific type). Pass a setting type (like 'sectionend') to insert after a setting type.
|
||||
*/
|
||||
public static function insert_setting_after( &$settings, $insert_after_setting_id, $new_setting, $insert_type = 'single_setting', $insert_after = 'first' ) {
|
||||
if ( ! is_array( $settings ) ) {
|
||||
@@ -2077,7 +2157,7 @@ class WC_Subscriptions_Admin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a translation safe screen ID for Subcsription
|
||||
* Set a translation safe screen ID for Subscriptions
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v1.3.3
|
||||
*/
|
||||
@@ -2160,7 +2240,7 @@ class WC_Subscriptions_Admin {
|
||||
* @return string $from Origin type.
|
||||
* @param string $to New type.
|
||||
*
|
||||
* @return bool Whehter the variations should be deleted.
|
||||
* @return bool Whether the variations should be deleted.
|
||||
*/
|
||||
public static function maybe_keep_variations( $delete_variations, $product, $from, $to ) {
|
||||
|
||||
|
@@ -67,6 +67,7 @@ class WCS_Admin_Post_Types {
|
||||
add_action( 'parse_query', array( $this, 'shop_subscription_search_custom_fields' ) );
|
||||
|
||||
add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
|
||||
add_filter( 'woocommerce_order_updated_messages', array( $this, 'post_updated_messages' ) );
|
||||
|
||||
// Add ListTable filters when CPT is enabled
|
||||
add_action( 'restrict_manage_posts', array( $this, 'restrict_by_product' ) );
|
||||
@@ -128,7 +129,7 @@ class WCS_Admin_Post_Types {
|
||||
public function is_db_user_privileged() {
|
||||
$permissions = $this->get_special_database_privileges();
|
||||
|
||||
return ( in_array( 'CREATE TEMPORARY TABLES', $permissions ) && in_array( 'INDEX', $permissions ) && in_array( 'DROP', $permissions ) );
|
||||
return ( in_array( 'CREATE TEMPORARY TABLES', $permissions, true ) && in_array( 'INDEX', $permissions, true ) && in_array( 'DROP', $permissions, true ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,14 +188,17 @@ class WCS_Admin_Post_Types {
|
||||
$table_name = substr( "{$wpdb->prefix}tmp_{$session}_lastpayment", 0, 64 );
|
||||
|
||||
// Let's create a temporary table, drop the previous one, because otherwise this query is hella slow
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
|
||||
$wpdb->query( "DROP TEMPORARY TABLE IF EXISTS {$table_name}" );
|
||||
|
||||
$wpdb->query(
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
|
||||
"CREATE TEMPORARY TABLE {$table_name} (id INT PRIMARY KEY, last_payment DATETIME) AS
|
||||
SELECT pm.meta_value as id, MAX( p.post_date_gmt ) as last_payment FROM {$wpdb->postmeta} pm
|
||||
LEFT JOIN {$wpdb->posts} p ON p.ID = pm.post_id
|
||||
WHERE pm.meta_key = '_subscription_renewal'
|
||||
GROUP BY pm.meta_value" );
|
||||
GROUP BY pm.meta_value"
|
||||
);
|
||||
// Magic ends here
|
||||
|
||||
$pieces['join'] .= "LEFT JOIN {$table_name} lp
|
||||
@@ -220,23 +224,25 @@ class WCS_Admin_Post_Types {
|
||||
return;
|
||||
}
|
||||
|
||||
$product_id = '';
|
||||
$product_id = '';
|
||||
$product_string = '';
|
||||
|
||||
if ( ! empty( $_GET['_wcs_product'] ) ) {
|
||||
$product_id = absint( $_GET['_wcs_product'] );
|
||||
if ( ! empty( $_GET['_wcs_product'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
$product_id = absint( $_GET['_wcs_product'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
$product_string = wc_get_product( $product_id )->get_formatted_name();
|
||||
}
|
||||
|
||||
WCS_Select2::render( array(
|
||||
'class' => 'wc-product-search',
|
||||
'name' => '_wcs_product',
|
||||
'placeholder' => esc_attr__( 'Search for a product…', 'woocommerce-subscriptions' ),
|
||||
'action' => 'woocommerce_json_search_products_and_variations',
|
||||
'selected' => strip_tags( $product_string ),
|
||||
'value' => $product_id,
|
||||
'allow_clear' => 'true',
|
||||
) );
|
||||
WCS_Select2::render(
|
||||
array(
|
||||
'class' => 'wc-product-search',
|
||||
'name' => '_wcs_product',
|
||||
'placeholder' => esc_attr__( 'Search for a product…', 'woocommerce-subscriptions' ),
|
||||
'action' => 'woocommerce_json_search_products_and_variations',
|
||||
'selected' => wp_strip_all_tags( $product_string ),
|
||||
'value' => $product_id,
|
||||
'allow_clear' => 'true',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -360,9 +366,9 @@ class WCS_Admin_Post_Types {
|
||||
|
||||
$action = '';
|
||||
|
||||
if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
|
||||
if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) { // phpcs:ignore
|
||||
$action = wc_clean( wp_unslash( $_REQUEST['action'] ) );
|
||||
} elseif ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {
|
||||
} elseif ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) { // phpcs:ignore
|
||||
$action = wc_clean( wp_unslash( $_REQUEST['action2'] ) );
|
||||
}
|
||||
|
||||
@@ -549,10 +555,10 @@ class WCS_Admin_Post_Types {
|
||||
break;
|
||||
|
||||
case 'order_title':
|
||||
|
||||
$customer_tip = '';
|
||||
|
||||
if ( $address = $the_subscription->get_formatted_billing_address() ) {
|
||||
$address = $the_subscription->get_formatted_billing_address();
|
||||
if ( $address ) {
|
||||
$customer_tip .= _x( 'Billing:', 'meaning billing address', 'woocommerce-subscriptions' ) . ' ' . esc_html( $address );
|
||||
}
|
||||
|
||||
@@ -567,15 +573,16 @@ class WCS_Admin_Post_Types {
|
||||
}
|
||||
|
||||
if ( ! empty( $customer_tip ) ) {
|
||||
echo '<div class="tips" data-tip="' . wc_sanitize_tooltip( $customer_tip ) . '">'; // XSS ok.
|
||||
echo '<div class="tips" data-tip="' . wc_sanitize_tooltip( $customer_tip ) . '">'; // phpcs:ignore Standard.Category.SniffName.ErrorCode
|
||||
}
|
||||
|
||||
// This is to stop PHP from complaining
|
||||
$username = '';
|
||||
|
||||
if ( $the_subscription->get_user_id() && ( false !== ( $user_info = get_userdata( $the_subscription->get_user_id() ) ) ) ) {
|
||||
$user_info = get_userdata( $the_subscription->get_user_id() );
|
||||
if ( $the_subscription->get_user_id() && ( false !== $user_info ) ) {
|
||||
|
||||
$username = '<a href="user-edit.php?user_id=' . absint( $user_info->ID ) . '">';
|
||||
$username = '<a href="user-edit.php?user_id=' . absint( $user_info->ID ) . '">';
|
||||
|
||||
if ( $the_subscription->get_billing_first_name() || $the_subscription->get_billing_last_name() ) {
|
||||
$username .= esc_html( ucfirst( $the_subscription->get_billing_first_name() ) . ' ' . ucfirst( $the_subscription->get_billing_last_name() ) );
|
||||
@@ -639,7 +646,7 @@ class WCS_Admin_Post_Types {
|
||||
break;
|
||||
|
||||
case 'recurring_total':
|
||||
$column_content .= esc_html( strip_tags( $the_subscription->get_formatted_order_total() ) );
|
||||
$column_content .= esc_html( wp_strip_all_tags( $the_subscription->get_formatted_order_total() ) );
|
||||
$column_content .= '<small class="meta">';
|
||||
// translators: placeholder is the display name of a payment gateway a subscription was paid by
|
||||
$column_content .= esc_html( sprintf( __( 'Via %s', 'woocommerce-subscriptions' ), $the_subscription->get_payment_method_to_display() ) );
|
||||
@@ -682,7 +689,7 @@ class WCS_Admin_Post_Types {
|
||||
$date_type = array_key_exists( $column, $date_type_map ) ? $date_type_map[ $column ] : $column;
|
||||
$datetime = wcs_get_datetime_from( $subscription->get_time( $date_type ) );
|
||||
|
||||
if ( 0 == $subscription->get_time( $date_type, 'gmt' ) ) {
|
||||
if ( 0 == $subscription->get_time( $date_type, 'gmt' ) ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
|
||||
$column_content = '-';
|
||||
} else {
|
||||
$accurate_date = $datetime->date_i18n( __( 'Y/m/d g:i:s A', 'woocommerce-subscriptions' ) );
|
||||
@@ -744,7 +751,6 @@ class WCS_Admin_Post_Types {
|
||||
/**
|
||||
* Search custom fields as well as content.
|
||||
*
|
||||
* @access public
|
||||
* @param WP_Query $wp
|
||||
* @return void
|
||||
*/
|
||||
@@ -755,7 +761,7 @@ class WCS_Admin_Post_Types {
|
||||
return;
|
||||
}
|
||||
|
||||
$post_ids = wcs_subscription_search( $_GET['s'] );
|
||||
$post_ids = isset( $_GET['s'] ) ? wcs_subscription_search( wc_clean( wp_unslash( $_GET['s'] ) ) ) : []; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
|
||||
if ( ! empty( $post_ids ) ) {
|
||||
|
||||
@@ -773,7 +779,6 @@ class WCS_Admin_Post_Types {
|
||||
/**
|
||||
* Change the label when searching orders.
|
||||
*
|
||||
* @access public
|
||||
* @param mixed $query
|
||||
* @return string
|
||||
*/
|
||||
@@ -792,13 +797,12 @@ class WCS_Admin_Post_Types {
|
||||
return $query;
|
||||
}
|
||||
|
||||
return wp_unslash( $_GET['s'] );
|
||||
return isset( $_GET['s'] ) ? wc_clean( wp_unslash( $_GET['s'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
}
|
||||
|
||||
/**
|
||||
* Query vars for custom searches.
|
||||
*
|
||||
* @access public
|
||||
* @param mixed $public_query_vars
|
||||
* @return array
|
||||
*/
|
||||
@@ -1056,7 +1060,7 @@ class WCS_Admin_Post_Types {
|
||||
*
|
||||
* There are a few special conditions for handling the post__in value. Namely:
|
||||
* - if there are no matching post_ids, the value should be array( 0 ), not an empty array()
|
||||
* - if there are existing IDs in post__in, we only want to retun posts with an ID in both
|
||||
* - if there are existing IDs in post__in, we only want to return posts with an ID in both
|
||||
* the existing set and the new set
|
||||
*
|
||||
* While this method is public, it should not be used as it will eventually be deprecated and
|
||||
@@ -1092,7 +1096,17 @@ class WCS_Admin_Post_Types {
|
||||
* @return array
|
||||
*/
|
||||
public function post_updated_messages( $messages ) {
|
||||
global $post, $post_ID;
|
||||
global $post, $theorder;
|
||||
|
||||
if ( ! isset( $theorder ) || ! $theorder instanceof WC_Subscription ) {
|
||||
if ( ! isset( $post ) || 'shop_subscription' !== $post->post_type ) {
|
||||
return $messages;
|
||||
} elseif ( class_exists( 'Automattic\WooCommerce\Utilities\OrderUtil' ) ) {
|
||||
\Automattic\WooCommerce\Utilities\OrderUtil::init_theorder_object( $post );
|
||||
} else {
|
||||
return $messages;
|
||||
}
|
||||
}
|
||||
|
||||
$messages['shop_subscription'] = array(
|
||||
0 => '', // Unused. Messages start at index 1.
|
||||
@@ -1101,12 +1115,12 @@ class WCS_Admin_Post_Types {
|
||||
3 => __( 'Custom field deleted.', 'woocommerce-subscriptions' ),
|
||||
4 => __( 'Subscription updated.', 'woocommerce-subscriptions' ),
|
||||
// translators: placeholder is previous post title
|
||||
5 => isset( $_GET['revision'] ) ? sprintf( _x( 'Subscription restored to revision from %s', 'used in post updated messages', 'woocommerce-subscriptions' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
||||
5 => isset( $_GET['revision'] ) ? sprintf( _x( 'Subscription restored to revision from %s', 'used in post updated messages', 'woocommerce-subscriptions' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, // // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
6 => __( 'Subscription updated.', 'woocommerce-subscriptions' ),
|
||||
7 => __( 'Subscription saved.', 'woocommerce-subscriptions' ),
|
||||
8 => __( 'Subscription submitted.', 'woocommerce-subscriptions' ),
|
||||
// translators: php date string
|
||||
9 => sprintf( __( 'Subscription scheduled for: %1$s.', 'woocommerce-subscriptions' ), '<strong>' . date_i18n( _x( 'M j, Y @ G:i', 'used in "Subscription scheduled for <date>"', 'woocommerce-subscriptions' ), wcs_date_to_time( $post->post_date ) ) . '</strong>' ),
|
||||
9 => sprintf( __( 'Subscription scheduled for: %1$s.', 'woocommerce-subscriptions' ), '<strong>' . date_i18n( _x( 'M j, Y @ G:i', 'used in "Subscription scheduled for <date>"', 'woocommerce-subscriptions' ), strtotime( $theorder->get_date_created() ?? $post->post_date ) ) . '</strong>' ),
|
||||
10 => __( 'Subscription draft updated.', 'woocommerce-subscriptions' ),
|
||||
);
|
||||
|
||||
@@ -1146,19 +1160,21 @@ class WCS_Admin_Post_Types {
|
||||
return;
|
||||
}
|
||||
|
||||
$selected_gateway_id = ( ! empty( $_GET['_payment_method'] ) ) ? $_GET['_payment_method'] : ''; ?>
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
$selected_gateway_id = ( ! empty( $_GET['_payment_method'] ) ) ? wc_clean( wp_unslash( $_GET['_payment_method'] ) ) : ''; ?>
|
||||
|
||||
<select class="wcs_payment_method_selector" name="_payment_method" id="_payment_method" class="first">
|
||||
<option value=""><?php esc_html_e( 'Any Payment Method', 'woocommerce-subscriptions' ) ?></option>
|
||||
<option value="none" <?php echo esc_attr( 'none' == $selected_gateway_id ? 'selected' : '' ) . '>' . esc_html__( 'None', 'woocommerce-subscriptions' ) ?></option>
|
||||
<option value=""><?php esc_html_e( 'Any Payment Method', 'woocommerce-subscriptions' ); ?></option>
|
||||
<option value="none" <?php echo esc_attr( 'none' === $selected_gateway_id ? 'selected' : '' ) . '>' . esc_html__( 'None', 'woocommerce-subscriptions' ); ?></option>
|
||||
<?php
|
||||
|
||||
foreach ( WC()->payment_gateways->get_available_payment_gateways() as $gateway_id => $gateway ) {
|
||||
echo '<option value="' . esc_attr( $gateway_id ) . '"' . ( $selected_gateway_id == $gateway_id ? 'selected' : '' ) . '>' . esc_html( $gateway->title ) . '</option>';
|
||||
echo '<option value="' . esc_attr( $gateway_id ) . '"' . ( $selected_gateway_id === $gateway_id ? 'selected' : '' ) . '>' . esc_html( $gateway->title ) . '</option>';
|
||||
}
|
||||
echo '<option value="_manual_renewal">' . esc_html__( 'Manual Renewal', 'woocommerce-subscriptions' ) . '</option>';
|
||||
?>
|
||||
</select> <?php
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1170,7 +1186,7 @@ class WCS_Admin_Post_Types {
|
||||
*/
|
||||
public function list_table_primary_column( $default, $screen_id ) {
|
||||
|
||||
if ( 'edit-shop_subscription' == $screen_id ) {
|
||||
if ( in_array( $screen_id, [ wcs_get_page_screen_id( 'shop_subscription' ), 'edit-shop_subscription' ], true ) ) {
|
||||
$default = 'order_title';
|
||||
}
|
||||
|
||||
@@ -1187,7 +1203,7 @@ class WCS_Admin_Post_Types {
|
||||
*/
|
||||
public function shop_subscription_row_actions( $actions, $post ) {
|
||||
|
||||
if ( 'shop_subscription' == $post->post_type ) {
|
||||
if ( 'shop_subscription' === $post->post_type ) {
|
||||
$actions = array();
|
||||
}
|
||||
|
||||
@@ -1207,12 +1223,15 @@ class WCS_Admin_Post_Types {
|
||||
wcs_deprecated_argument( __METHOD__, '3.0.7', 'The second parameter (product) is no longer used.' );
|
||||
}
|
||||
|
||||
$item_meta_html = wc_display_item_meta( $item, array(
|
||||
$item_meta_html = wc_display_item_meta(
|
||||
$item,
|
||||
array(
|
||||
'before' => '',
|
||||
'after' => '',
|
||||
'separator' => '',
|
||||
'echo' => false,
|
||||
) );
|
||||
)
|
||||
);
|
||||
|
||||
return $item_meta_html;
|
||||
}
|
||||
@@ -1226,7 +1245,7 @@ class WCS_Admin_Post_Types {
|
||||
*/
|
||||
protected static function get_item_name_html( $item, $_product, $include_quantity = 'include_quantity' ) {
|
||||
|
||||
$item_quantity = absint( $item['qty'] );
|
||||
$item_quantity = absint( $item['qty'] );
|
||||
|
||||
$item_name = '';
|
||||
|
||||
@@ -1271,8 +1290,9 @@ class WCS_Admin_Post_Types {
|
||||
echo wp_kses( $item_name, array( 'a' => array( 'href' => array() ) ) );
|
||||
|
||||
if ( $item_meta_html ) {
|
||||
echo wcs_help_tip( $item_meta_html, true );
|
||||
} ?>
|
||||
echo esc_html( wcs_help_tip( $item_meta_html, true ) );
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
@@ -1358,7 +1378,7 @@ class WCS_Admin_Post_Types {
|
||||
}
|
||||
|
||||
$action_url = add_query_arg( $action_url_args );
|
||||
$action_url = remove_query_arg( [ 'changed', 'ids' ], $action_url );
|
||||
$action_url = remove_query_arg( [ 'changed', 'ids', 'filter_action' ], $action_url );
|
||||
$all_statuses = array(
|
||||
'active' => __( 'Reactivate', 'woocommerce-subscriptions' ),
|
||||
'on-hold' => __( 'Suspend', 'woocommerce-subscriptions' ),
|
||||
@@ -1704,7 +1724,7 @@ class WCS_Admin_Post_Types {
|
||||
* @param string $item_name The line item's name.
|
||||
* @param string $item_meta_html The line item's meta HTML.
|
||||
*
|
||||
* @return string The subcription line item column HTML content.
|
||||
* @return string The subscription line item column HTML content.
|
||||
*/
|
||||
protected static function get_item_display_div( $item, $item_name, $item_meta_html ) {
|
||||
wcs_deprecated_function( '__METHOD__', '3.0.7' );
|
||||
|
@@ -54,7 +54,7 @@ class WCS_Admin_Product_Import_Export_Manager {
|
||||
if ( 'subscription_variation' === $product_type ) {
|
||||
$export_subscription_variations = true;
|
||||
|
||||
// All variation products are exported with the 'variation' key so remove the uneeded `subscription_variation`.
|
||||
// All variation products are exported with the 'variation' key so remove the unneeded `subscription_variation`.
|
||||
// Further filtering by product type will be handled by the query args (see below).
|
||||
unset( $args['type'][ $index ] );
|
||||
} elseif ( 'variation' === $product_type ) {
|
||||
@@ -88,7 +88,7 @@ class WCS_Admin_Product_Import_Export_Manager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters product import data so subcription variations are imported correctly (as variations).
|
||||
* Filters product import data so subscription variations are imported correctly (as variations).
|
||||
*
|
||||
* Subscription variations are the exact same as standard variations. What sets them apart is the fact they are linked
|
||||
* to a variable subscription parent rather than a standard variable product. With that in mind, we need to import them just
|
||||
|
@@ -40,6 +40,16 @@ class WCS_WC_Admin_Manager {
|
||||
)
|
||||
);
|
||||
|
||||
// WooCommerce > Subscriptions (HPOS)
|
||||
wc_admin_connect_page(
|
||||
array(
|
||||
'id' => 'woocommerce-custom-orders-subscriptions',
|
||||
'screen_id' => wcs_get_page_screen_id( 'shop_subscription' ),
|
||||
'title' => __( 'Subscriptions', 'woocommerce-subscriptions' ),
|
||||
'path' => 'admin.php?page=wc-orders--shop_subscription',
|
||||
)
|
||||
);
|
||||
|
||||
// WooCommerce > Subscriptions > Add New.
|
||||
wc_admin_connect_page(
|
||||
array(
|
||||
|
@@ -57,7 +57,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
<strong><?php echo esc_html( $date_label ); ?>:</strong>
|
||||
<input type="hidden" name="<?php echo esc_attr( $date_key ); ?>_timestamp_utc" id="<?php echo esc_attr( $date_key ); ?>_timestamp_utc" value="<?php echo esc_attr( $the_subscription->get_time( $internal_date_key, 'gmt' ) ); ?>"/>
|
||||
<?php if ( $the_subscription->can_date_be_updated( $internal_date_key ) ) : ?>
|
||||
<?php echo wp_kses( wcs_date_input( $the_subscription->get_time( $internal_date_key, 'site' ), array( 'name_attr' => $date_key ) ), array( 'input' => array( 'type' => array(), 'class' => array(), 'placeholder' => array(), 'name' => array(), 'id' => array(), 'maxlength' => array(), 'size' => array(), 'value' => array(), 'patten' => array() ), 'div' => array( 'class' => array() ), 'span' => array(), 'br' => array() ) ); // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound ?>
|
||||
<?php echo wp_kses( wcs_date_input( $the_subscription->get_time( $internal_date_key, 'site' ), array( 'name_attr' => $date_key ) ), array( 'input' => array( 'type' => array(), 'class' => array(), 'placeholder' => array(), 'name' => array(), 'id' => array(), 'maxlength' => array(), 'size' => array(), 'value' => array(), 'pattern' => array() ), 'div' => array( 'class' => array() ), 'span' => array(), 'br' => array() ) ); // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound ?>
|
||||
<?php else : ?>
|
||||
<?php echo esc_html( $the_subscription->get_date_to_display( $internal_date_key ) ); ?>
|
||||
<?php endif; ?>
|
||||
|
@@ -296,7 +296,7 @@ class WC_Product_Variable_Subscription extends WC_Product_Variable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sync variable product prices with the childs lowest/highest prices.
|
||||
* Sync variable product prices with the children lowest/highest prices.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
|
@@ -57,7 +57,7 @@ class WC_Subscription extends WC_Order {
|
||||
'billing_period' => '',
|
||||
'billing_interval' => 1,
|
||||
'suspension_count' => 0,
|
||||
'requires_manual_renewal' => 'true',
|
||||
'requires_manual_renewal' => true,
|
||||
'cancelled_email_sent' => false,
|
||||
'trial_period' => '',
|
||||
|
||||
@@ -365,7 +365,7 @@ class WC_Subscription extends WC_Order {
|
||||
}
|
||||
break;
|
||||
case 'pending-cancel' :
|
||||
// Only active subscriptions can be given the "pending cancellation" status, becuase it is used to account for a prepaid term
|
||||
// Only active subscriptions can be given the "pending cancellation" status, because it is used to account for a prepaid term
|
||||
if ( $this->payment_method_supports( 'subscription_cancellation' ) ) {
|
||||
if ( $this->has_status( 'active' ) ) {
|
||||
$can_be_updated = true;
|
||||
@@ -953,10 +953,10 @@ class WC_Subscription extends WC_Order {
|
||||
* The more aptly named set_schedule_start() cannot exist because then WC core thinks the _schedule_start meta is an
|
||||
* internal meta key and throws errors.
|
||||
*
|
||||
* @param string $schedule_start
|
||||
* @param string $schedule_start The date to set the start date to. Should be a WC_DateTime or a string in the format 'Y-m-d H:i:s' (UTC).
|
||||
*/
|
||||
public function set_start_date( $schedule_start ) {
|
||||
$this->set_prop( 'schedule_start', $schedule_start );
|
||||
$this->set_date_prop( 'start', is_a( $schedule_start, 'WC_DateTime' ) ? $schedule_start : wcs_date_to_time( $schedule_start ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2773,7 +2773,7 @@ class WC_Subscription extends WC_Order {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Pass a timestamp to the WC 3.0 setters becasue WC expects MySQL date strings to be in site's timezone, but we have a date string in UTC timezone
|
||||
// Pass a timestamp to the WC 3.0 setters because WC expects MySQL date strings to be in site's timezone, but we have a date string in UTC timezone
|
||||
$timestamp = ( $datetime > 0 ) ? wcs_date_to_time( $datetime ) : 0;
|
||||
|
||||
$this->set_last_order_date( 'date_paid', $timestamp );
|
||||
|
@@ -46,8 +46,10 @@ class WC_Subscriptions_Cart_Validator {
|
||||
$product = wc_get_product( $product_id );
|
||||
|
||||
// If the product is sold individually or if the cart doesn't already contain this product, empty the cart.
|
||||
if ( ( $product && $product->is_sold_individually() ) || ! WC()->cart->find_product_in_cart( $cart_item_id ) ) {
|
||||
if ( ! WC()->cart->is_empty() && ( ( $product && $product->is_sold_individually() ) || ! WC()->cart->find_product_in_cart( $cart_item_id ) ) ) {
|
||||
$message = $cart_contains_subscription ? __( 'A subscription has been removed from your cart. Only one subscription product can be purchased at a time.', 'woocommerce-subscriptions' ) : __( 'Products have been removed from your cart. Products and subscriptions can not be purchased at the same time.', 'woocommerce-subscriptions' );
|
||||
WC()->cart->empty_cart();
|
||||
wc_add_notice( $message, 'notice' );
|
||||
}
|
||||
} elseif ( $is_subscription && wcs_cart_contains_renewal() && ! $multiple_subscriptions_possible && ! $manual_renewals_enabled ) {
|
||||
|
||||
@@ -68,7 +70,7 @@ class WC_Subscriptions_Cart_Validator {
|
||||
wc_add_notice( __( 'A subscription has been removed from your cart. Products and subscriptions can not be purchased at the same time.', 'woocommerce-subscriptions' ), 'notice' );
|
||||
|
||||
// Redirect to cart page to remove subscription & notify shopper
|
||||
add_filter( 'woocommerce_add_to_cart_fragments', array( __CLASS__, 'redirect_ajax_add_to_cart' ) );
|
||||
add_filter( 'woocommerce_add_to_cart_fragments', array( __CLASS__, 'add_to_cart_ajax_redirect' ) );
|
||||
}
|
||||
|
||||
return $valid;
|
||||
@@ -107,7 +109,7 @@ class WC_Subscriptions_Cart_Validator {
|
||||
wc_add_notice( __( 'Your cart has been emptied of subscription products. Only one subscription product can be purchased at a time.', 'woocommerce-subscriptions' ), 'notice' );
|
||||
|
||||
// Redirect to cart page to remove subscription & notify shopper
|
||||
add_filter( 'woocommerce_add_to_cart_fragments', array( __CLASS__, 'redirect_ajax_add_to_cart' ) );
|
||||
add_filter( 'woocommerce_add_to_cart_fragments', array( __CLASS__, 'add_to_cart_ajax_redirect' ) );
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -137,7 +139,7 @@ class WC_Subscriptions_Cart_Validator {
|
||||
*
|
||||
* Attached by @see WC_Subscriptions_Cart_Validator::validate_cart_contents_for_mixed_checkout() and
|
||||
* @see WC_Subscriptions_Cart_Validator::maybe_empty_cart() when the store has multiple subscription
|
||||
* purcahses disabled, the cart already contains products and the customer adds a new item or logs in
|
||||
* purchases disabled, the cart already contains products and the customer adds a new item or logs in
|
||||
* causing a cart merge.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v4.0.0
|
||||
|
@@ -543,7 +543,7 @@ class WC_Subscriptions_Change_Payment_Gateway {
|
||||
wc_add_notice( $message, 'error' );
|
||||
}
|
||||
|
||||
// Add an error notice specific to this error if it hasn't been added yet. This will generate the unique list of errors which occured.
|
||||
// Add an error notice specific to this error if it hasn't been added yet. This will generate the unique list of errors which occurred.
|
||||
$error_message = sprintf(
|
||||
__( '%1$sError:%2$s %3$s', 'woocommerce-subscriptions' ),
|
||||
'<strong>',
|
||||
|
@@ -476,7 +476,7 @@ class WC_Subscriptions_Checkout {
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the 'registeration required' (guest checkout) setting when purchasing subscriptions.
|
||||
* Enables the 'registration required' (guest checkout) setting when purchasing subscriptions.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v3.1.0
|
||||
*
|
||||
|
@@ -16,7 +16,7 @@ class WC_Subscriptions_Core_Plugin {
|
||||
* The version of subscriptions-core library.
|
||||
* @var string
|
||||
*/
|
||||
protected $library_version = '7.0.0'; // WRCS: DEFINED_VERSION.
|
||||
protected $library_version = '7.1.1'; // WRCS: DEFINED_VERSION.
|
||||
|
||||
/**
|
||||
* The subscription scheduler instance.
|
||||
@@ -94,7 +94,7 @@ class WC_Subscriptions_Core_Plugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines WC Subscriptions contants.
|
||||
* Defines WC Subscriptions constants.
|
||||
*/
|
||||
protected function define_constants() {
|
||||
define( 'WCS_INIT_TIMESTAMP', gmdate( 'U' ) );
|
||||
@@ -531,7 +531,7 @@ class WC_Subscriptions_Core_Plugin {
|
||||
public function load_plugin_textdomain() {
|
||||
$plugin_rel_path = apply_filters( 'woocommerce_subscriptions_translation_file_rel_path', $this->get_subscriptions_core_directory() . '/languages' );
|
||||
|
||||
// Then check for a language file in /wp-content/plugins/woocommerce-subscriptions/languages/ (this will be overriden by any file already loaded)
|
||||
// Then check for a language file in /wp-content/plugins/woocommerce-subscriptions/languages/ (this will be overridden by any file already loaded)
|
||||
load_plugin_textdomain( 'woocommerce-subscriptions', false, $plugin_rel_path );
|
||||
}
|
||||
|
||||
|
@@ -727,7 +727,7 @@ class WC_Subscriptions_Coupon {
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v4.0.0
|
||||
*
|
||||
* @param string $coupon_type The coupon's type.
|
||||
* @return bool Whether the coupon is a recuring cart virtual coupon.
|
||||
* @return bool Whether the coupon is a recurring cart virtual coupon.
|
||||
*/
|
||||
public static function is_renewal_cart_coupon( $coupon_type ) {
|
||||
return isset( self::$renewal_coupons[ $coupon_type ] );
|
||||
@@ -739,7 +739,7 @@ class WC_Subscriptions_Coupon {
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v4.0.0
|
||||
*
|
||||
* @param string $coupon_type The coupon's type.
|
||||
* @return bool Whether the coupon is a recuring cart virtual coupon.
|
||||
* @return bool Whether the coupon is a recurring cart virtual coupon.
|
||||
*/
|
||||
public static function is_recurring_coupon( $coupon_type ) {
|
||||
return isset( self::$recurring_coupons[ $coupon_type ] );
|
||||
@@ -933,7 +933,7 @@ class WC_Subscriptions_Coupon {
|
||||
|
||||
if ( ! empty( self::$removed_coupons ) ) {
|
||||
|
||||
// Can't use $cart->add_dicount here as it calls calculate_totals()
|
||||
// Can't use $cart->add_discount here as it calls calculate_totals()
|
||||
$cart->applied_coupons = array_merge( $cart->applied_coupons, self::$removed_coupons );
|
||||
|
||||
if ( isset( $cart->coupons ) ) { // WC 2.3+
|
||||
|
@@ -1369,7 +1369,7 @@ class WC_Subscriptions_Manager {
|
||||
}
|
||||
|
||||
/**
|
||||
* A subscription now either has an end date or it doesn't, there is no way to calculate it based on the original subsciption
|
||||
* A subscription now either has an end date or it doesn't, there is no way to calculate it based on the original subscription
|
||||
* product (because a WC_Subscription object can have more than one product and syncing length with expiration date was both
|
||||
* cumbersome and error prone).
|
||||
*
|
||||
@@ -1852,9 +1852,9 @@ class WC_Subscriptions_Manager {
|
||||
*/
|
||||
public static function get_amount_from_proportion( $total, $proportion ) {
|
||||
|
||||
$sign_up_fee_proprotion = 1 - $proportion;
|
||||
$sign_up_fee_proportion = 1 - $proportion;
|
||||
|
||||
$sign_up_total = round( $total * $sign_up_fee_proprotion, 2 );
|
||||
$sign_up_total = round( $total * $sign_up_fee_proportion, 2 );
|
||||
$recurring_amount = round( $total * $proportion, 2 );
|
||||
|
||||
// Handle any rounding bugs
|
||||
@@ -2058,7 +2058,7 @@ class WC_Subscriptions_Manager {
|
||||
* if the amount is for $0 (and therefore, there is no payment to be processed by a gateway, and likely
|
||||
* no gateway used on the initial order).
|
||||
*
|
||||
* If a subscription has a $0 recurring total and is not already active (after being actived by something else
|
||||
* If a subscription has a $0 recurring total and is not already active (after being activated by something else
|
||||
* handling the 'scheduled_subscription_payment' with the default priority of 10), then this function will call
|
||||
* @see self::process_subscription_payment() to reactive the subscription, generate a renewal order etc.
|
||||
*
|
||||
|
@@ -608,7 +608,7 @@ class WC_Subscriptions_Order {
|
||||
/* Edit Order Page Content */
|
||||
|
||||
/**
|
||||
* Returns all parent subscription orders for a user, specificed with $user_id
|
||||
* Returns all parent subscription orders for a user, specified with $user_id
|
||||
*
|
||||
* @return array An array of order IDs.
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v1.4
|
||||
@@ -787,7 +787,7 @@ class WC_Subscriptions_Order {
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the arguments to be pased to `wc_get_orders()` under the Woocommerce -> Orders screen.
|
||||
* Filters the arguments to be passed to `wc_get_orders()` under the Woocommerce -> Orders screen.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
@@ -947,7 +947,7 @@ class WC_Subscriptions_Order {
|
||||
* against the line item on the original order for that subscription.
|
||||
*
|
||||
* In v2.0, this data was moved to a distinct subscription object which had its own line items for those amounts.
|
||||
* This function bridges the two data structures to support deprecated functions used to retreive a subscription's
|
||||
* This function bridges the two data structures to support deprecated functions used to retrieve a subscription's
|
||||
* meta data from the original order rather than the subscription itself.
|
||||
*
|
||||
* @param WC_Order $order A WC_Order object
|
||||
@@ -985,7 +985,7 @@ class WC_Subscriptions_Order {
|
||||
* against the line item on the original order for that subscription.
|
||||
*
|
||||
* In v2.0, this data was moved to a distinct subscription object which had its own line items for those amounts.
|
||||
* This function bridges the two data structures to support deprecated functions used to retreive a subscription's
|
||||
* This function bridges the two data structures to support deprecated functions used to retrieve a subscription's
|
||||
* meta data from the original order rather than the subscription itself.
|
||||
*
|
||||
* @param WC_Order $order A WC_Order object
|
||||
@@ -1388,7 +1388,7 @@ class WC_Subscriptions_Order {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an order contains an in active subscription and if it does, denies download acces
|
||||
* Checks if an order contains an in active subscription and if it does, denies download access
|
||||
* to files purchased on the order.
|
||||
*
|
||||
* @return bool False if the order contains a subscription that has expired or is cancelled/on-hold, otherwise, the original value of $download_permitted
|
||||
@@ -2157,7 +2157,7 @@ class WC_Subscriptions_Order {
|
||||
/**
|
||||
* Returns the amount outstanding on a subscription product.
|
||||
*
|
||||
* Deprecated because the subscription oustanding balance on a subscription is no longer added and an order can contain more
|
||||
* Deprecated because the subscription outstanding balance on a subscription is no longer added and an order can contain more
|
||||
* than one subscription.
|
||||
*
|
||||
* @param WC_Order $order The WC_Order object of the order for which you want to determine the number of failed payments.
|
||||
@@ -2170,9 +2170,9 @@ class WC_Subscriptions_Order {
|
||||
|
||||
$failed_payment_count = self::get_failed_payment_count( $order, $product_id );
|
||||
|
||||
$oustanding_balance = $failed_payment_count * self::get_recurring_total( $order, $product_id );
|
||||
$outstanding_balance = $failed_payment_count * self::get_recurring_total( $order, $product_id );
|
||||
|
||||
return $oustanding_balance;
|
||||
return $outstanding_balance;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -883,7 +883,7 @@ class WC_Subscriptions_Product {
|
||||
* @param string $bulk_action The bulk edit action being performed
|
||||
* @param array $data An array of data relating to the bulk edit action. $data['value'] represents the new value for the meta.
|
||||
* @param int $variable_product_id The post ID of the parent variable product.
|
||||
* @param array $variation_ids An array of post IDs for the variable prodcut's variations.
|
||||
* @param array $variation_ids An array of post IDs for the variable product's variations.
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v1.5.29
|
||||
*/
|
||||
public static function bulk_edit_variations( $bulk_action, $data, $variable_product_id, $variation_ids ) {
|
||||
|
@@ -437,7 +437,7 @@ class WC_Subscriptions_Renewal_Order {
|
||||
* @param string $product_id The ID of the subscription product in the order which needs to be added to the new order.
|
||||
* @param array $args (optional) An array of name => value flags:
|
||||
* 'new_order_role' string A flag to indicate whether the new order should become the master order for the subscription. Accepts either 'parent' or 'child'. Defaults to 'parent' - replace the existing order.
|
||||
* 'checkout_renewal' bool Indicates if invoked from an interactive cart/checkout session and certain order items are not set, like taxes, shipping as they need to be set in teh calling function, like @see WC_Subscriptions_Checkout::filter_woocommerce_create_order(). Default false.
|
||||
* 'checkout_renewal' bool Indicates if invoked from an interactive cart/checkout session and certain order items are not set, like taxes, shipping as they need to be set in the calling function, like @see WC_Subscriptions_Checkout::filter_woocommerce_create_order(). Default false.
|
||||
* 'failed_order_id' int For checkout_renewal true, indicates order id being replaced
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v1.2
|
||||
* @deprecated 1.0.0 - Migrated from WooCommerce Subscriptions v2.0
|
||||
|
@@ -292,7 +292,7 @@ class WC_Subscriptions_Synchroniser {
|
||||
'options' => self::get_billing_period_ranges( $subscription_period ),
|
||||
'description' => self::$sync_description,
|
||||
'desc_tip' => true,
|
||||
'value' => $payment_day, // Explicity set value in to ensure backward compatibility
|
||||
'value' => $payment_day, // Explicitly set value in to ensure backward compatibility
|
||||
)
|
||||
);
|
||||
|
||||
@@ -603,7 +603,7 @@ class WC_Subscriptions_Synchroniser {
|
||||
*
|
||||
* @param WC_Product $product A subscription product.
|
||||
* @param string $type (optional) The format to return the first payment date in, either 'mysql' or 'timestamp'. Default 'mysql'.
|
||||
* @param string $from_date (optional) The date to calculate the first payment from in GMT/UTC timzeone. If not set, it will use the current date. This should not include any trial period on the product.
|
||||
* @param string $from_date (optional) The date to calculate the first payment from in GMT/UTC timezone. If not set, it will use the current date. This should not include any trial period on the product.
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v1.5
|
||||
*/
|
||||
public static function calculate_first_payment_date( $product, $type = 'mysql', $from_date = '' ) {
|
||||
@@ -1312,7 +1312,7 @@ class WC_Subscriptions_Synchroniser {
|
||||
* Gets the number of sign-up grace period days.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v3.0.6
|
||||
* @return int The number of days in the grace period. 0 will be returned if the stroe isn't charging the full recurring price on sign-up -- a prerequiste for setting a grace period.
|
||||
* @return int The number of days in the grace period. 0 will be returned if the store isn't charging the full recurring price on sign-up -- a prerequisite for setting a grace period.
|
||||
*/
|
||||
private static function get_number_of_grace_period_days() {
|
||||
return get_option( self::$setting_id_proration, 'no' ) === 'recurring' ? get_option( self::$setting_id_days_no_fee ) : 0;
|
||||
@@ -1483,7 +1483,7 @@ class WC_Subscriptions_Synchroniser {
|
||||
/**
|
||||
* Check if a given order included a subscription that is synced to a certain day.
|
||||
*
|
||||
* Deprecated becasuse _order_contains_synced_subscription is no longer stored on the order @see self::subscription_contains_synced_product
|
||||
* Deprecated because _order_contains_synced_subscription is no longer stored on the order @see self::subscription_contains_synced_product
|
||||
*
|
||||
* @param int $order_id The ID or a WC_Order item to check.
|
||||
* @return bool Returns true if the order contains a synced subscription, otherwise, false.
|
||||
|
@@ -30,7 +30,7 @@ class WCS_Action_Scheduler extends WCS_Scheduler {
|
||||
*
|
||||
* @param object $subscription An instance of a WC_Subscription object
|
||||
* @param string $date_type Can be 'trial_end', 'next_payment', 'payment_retry', 'end', 'end_of_prepaid_term' or a custom date type
|
||||
* @param string $datetime A MySQL formated date/time string in the GMT/UTC timezone.
|
||||
* @param string $datetime A MySQL formatted date/time string in the GMT/UTC timezone.
|
||||
*/
|
||||
public function update_date( $subscription, $date_type, $datetime ) {
|
||||
|
||||
@@ -77,7 +77,7 @@ class WCS_Action_Scheduler extends WCS_Scheduler {
|
||||
*
|
||||
* @param object $subscription An instance of a WC_Subscription object
|
||||
* @param string $date_type Can be 'trial_end', 'next_payment', 'end', 'end_of_prepaid_term' or a custom date type
|
||||
* @param string $datetime A MySQL formated date/time string in the GMT/UTC timezone.
|
||||
* @param string $datetime A MySQL formatted date/time string in the GMT/UTC timezone.
|
||||
*/
|
||||
public function update_status( $subscription, $new_status, $old_status ) {
|
||||
|
||||
|
@@ -27,7 +27,7 @@ class WCS_Cart_Initial_Payment extends WCS_Cart_Renewal {
|
||||
// Apply initial discounts when there is a pending initial order
|
||||
add_action( 'woocommerce_setup_cart_for_subscription_initial_payment', array( $this, 'setup_discounts' ) );
|
||||
|
||||
// Initialise the stock mananger.
|
||||
// Initialise the stock manager.
|
||||
WCS_Initial_Cart_Stock_Manager::attach_callbacks();
|
||||
}
|
||||
|
||||
|
@@ -465,7 +465,7 @@ class WCS_Cart_Renewal {
|
||||
|
||||
if ( isset( $item_to_renew['_subtracted_base_location_taxes'] ) ) {
|
||||
$price += array_sum( $item_to_renew['_subtracted_base_location_taxes'] ) * $item_to_renew['qty'];
|
||||
} else {
|
||||
} elseif ( isset( $item_to_renew['taxes']['subtotal'] ) ) {
|
||||
$price += array_sum( $item_to_renew['taxes']['subtotal'] ); // Use the taxes array items here as they contain taxes to a more accurate number of decimals.
|
||||
}
|
||||
}
|
||||
@@ -927,7 +927,7 @@ class WCS_Cart_Renewal {
|
||||
* Allow other plugins to remove/add fees of an existing order prior to building the cart without changing the saved order values
|
||||
* (e.g. payment gateway based fees can remove fees and later can add new fees depending on the actual selected payment gateway)
|
||||
*
|
||||
* @param WC_Order $order is renderd by reference - change meta data of this object
|
||||
* @param WC_Order $order is rendered by reference - change meta data of this object
|
||||
* @param WC_Cart $cart
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.2.9
|
||||
*/
|
||||
@@ -1835,7 +1835,7 @@ class WCS_Cart_Renewal {
|
||||
|
||||
$order_id = absint( WC()->session->order_awaiting_payment );
|
||||
|
||||
// Guard against infinite loops in WC 3.0+ where default order staus is set in WC_Abstract_Order::__construct()
|
||||
// Guard against infinite loops in WC 3.0+ where default order status is set in WC_Abstract_Order::__construct()
|
||||
remove_filter( 'woocommerce_default_order_status', array( &$this, __FUNCTION__ ), 10 );
|
||||
|
||||
$order = $order_id > 0 ? wc_get_order( $order_id ) : null;
|
||||
|
@@ -169,7 +169,7 @@ class WCS_Cart_Resubscribe extends WCS_Cart_Renewal {
|
||||
// Need to get the original subscription price, not the current price
|
||||
$subscription = wcs_get_subscription( $cart_item[ $this->cart_item_key ]['subscription_id'] );
|
||||
if ( $subscription ) {
|
||||
// Make sure the original subscription terms perisist
|
||||
// Make sure the original subscription terms persist
|
||||
$_product = $cart_item_session_data['data'];
|
||||
wcs_set_objects_property( $_product, 'subscription_period', $subscription->get_billing_period(), 'set_prop_only' );
|
||||
wcs_set_objects_property( $_product, 'subscription_period_interval', $subscription->get_billing_interval(), 'set_prop_only' );
|
||||
|
@@ -120,7 +120,7 @@ class WCS_Download_Handler {
|
||||
* download permissions stored on the subscription rather than the original order as the URL would have the wrong order
|
||||
* key. This function takes the same parameters, but queries the database again for download ids belonging to all the
|
||||
* subscriptions that were in the original order. Then for all subscriptions, it checks all items, and if the item
|
||||
* passed in here is in that subscription, it creates the correct download link to be passsed to the email.
|
||||
* passed in here is in that subscription, it creates the correct download link to be passed to the email.
|
||||
*
|
||||
* @param array $files List of files already included in the list
|
||||
* @param array $item An item (you get it by doing $order->get_items())
|
||||
@@ -196,7 +196,7 @@ class WCS_Download_Handler {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove download permissions attached to a subscription when it is permenantly deleted.
|
||||
* Remove download permissions attached to a subscription when it is permanently deleted.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.0
|
||||
*
|
||||
@@ -209,7 +209,7 @@ class WCS_Download_Handler {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove download permissions attached to a subscription when it is permenantly deleted.
|
||||
* Remove download permissions attached to a subscription when it is permanently deleted.
|
||||
*
|
||||
* @since 5.2.0
|
||||
*
|
||||
|
@@ -68,11 +68,14 @@ class WCS_Failed_Scheduled_Action_Manager {
|
||||
/**
|
||||
* Log a message to the failed-scheduled-actions log.
|
||||
*
|
||||
* @param string $message the message to be written to the log.
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.2.19
|
||||
*
|
||||
* @param string $message the message to be written to the log.
|
||||
* @param array $context the context to be included in the log. Optional. Default is an empty array.
|
||||
*/
|
||||
protected function log( $message ) {
|
||||
$this->logger->add( 'failed-scheduled-actions', $message );
|
||||
protected function log( $message, $context = [] ) {
|
||||
$context['source'] = 'failed-scheduled-actions';
|
||||
wc_get_logger()->error( $message, $context );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,20 +93,40 @@ class WCS_Failed_Scheduled_Action_Manager {
|
||||
}
|
||||
|
||||
$subscription_action = $this->get_action_hook_label( $action->get_hook() );
|
||||
$context = $this->get_context_from_action_error( $action, $error );
|
||||
|
||||
switch ( current_filter() ) {
|
||||
case 'action_scheduler_failed_action':
|
||||
$this->log( sprintf( 'scheduled action %s (%s) failed to finish processing after %s seconds', $action_id, $subscription_action, absint( $error ) ) );
|
||||
$this->log( sprintf( 'scheduled action %s (%s) failed to finish processing after %s seconds', $action_id, $subscription_action, absint( $error ) ), $context );
|
||||
break;
|
||||
case 'action_scheduler_failed_execution':
|
||||
$this->log( sprintf( 'scheduled action %s (%s) failed to finish processing due to the following exception: %s', $action_id, $subscription_action, $error->getMessage() ) );
|
||||
$this->log( sprintf( 'scheduled action %s (%s) failed to finish processing due to the following exception: %s', $action_id, $subscription_action, $this->get_message_from_exception( $error ) ), $context );
|
||||
break;
|
||||
case 'action_scheduler_unexpected_shutdown':
|
||||
$this->log( sprintf( 'scheduled action %s (%s) failed to finish processing due to the following error: %s', $action_id, $subscription_action, $error['message'] ) );
|
||||
$this->log( sprintf( 'scheduled action %s (%s) failed to finish processing due to the following error: %s', $action_id, $subscription_action, $this->get_message_from_error( $error ) ), $context );
|
||||
break;
|
||||
}
|
||||
|
||||
$this->log( sprintf( 'action args: %s', $this->get_action_args_string( $action->get_args() ) ) );
|
||||
// Prior to WC 8.6 the logger didn't display the context inline with the message so on those versions we log the context separately.
|
||||
if ( wcs_is_woocommerce_pre( '8.6' ) ) {
|
||||
foreach ( $context as $key => $value ) {
|
||||
if ( is_array( $value ) ) {
|
||||
$value = implode( PHP_EOL, $value );
|
||||
}
|
||||
|
||||
$this->log( "{$key}: {$value}" );
|
||||
}
|
||||
}
|
||||
|
||||
// Log any exceptions caught by the exception listener in action logs.
|
||||
if ( ! empty( $context['exceptions'] ) ) {
|
||||
foreach ( $context['exceptions'] as $exception_message ) {
|
||||
ActionScheduler_Logger::instance()->log( $action_id, $exception_message );
|
||||
}
|
||||
}
|
||||
|
||||
// Now that we've logged the exceptions, we can detach the exception listener.
|
||||
$this->clear_exceptions_and_detach_listener();
|
||||
|
||||
// Store information about the scheduled action for displaying an admin notice
|
||||
$failed_scheduled_actions = get_option( WC_Subscriptions_Admin::$option_prefix . '_failed_scheduled_actions', array() );
|
||||
@@ -114,18 +137,6 @@ class WCS_Failed_Scheduled_Action_Manager {
|
||||
);
|
||||
|
||||
update_option( WC_Subscriptions_Admin::$option_prefix . '_failed_scheduled_actions', $failed_scheduled_actions );
|
||||
|
||||
// If there is an exception listener and it's caught exceptions, log them for additional debugging.
|
||||
if ( ! empty( $this->exceptions ) ) {
|
||||
foreach ( $this->exceptions as $exception ) {
|
||||
$message = 'Exception: ' . $exception->getMessage() . ' in ' . $exception->getFile() . ':' . $exception->getLine();
|
||||
$this->log( $message . PHP_EOL . $exception->getTraceAsString() );
|
||||
ActionScheduler_Logger::instance()->log( $action_id, $message );
|
||||
}
|
||||
|
||||
// Now that we've logged the exceptions, we can detach the exception listener.
|
||||
$this->clear_exceptions_and_detach_listener();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -279,4 +290,68 @@ class WCS_Failed_Scheduled_Action_Manager {
|
||||
$store = ActionScheduler_Store::instance();
|
||||
return $store->fetch_action( $action_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a message from an exception.
|
||||
*
|
||||
* @param Exception $exception The exception to generate a message from.
|
||||
* @return string The message.
|
||||
*/
|
||||
protected function get_message_from_exception( $exception ) {
|
||||
// When Action Scheduler throws an exception, it wraps the original exception in a new Exception. Information about the actual error is stored in the previous exception.
|
||||
$previous = $exception->getPrevious();
|
||||
$exception = $previous ? $previous : $exception;
|
||||
|
||||
return $exception->getMessage() . ' in ' . $exception->getFile() . ':' . $exception->getLine();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a message from an error array.
|
||||
*
|
||||
* The $error variable is obtained from get_last_error() and has standard keys message, file and line.
|
||||
*
|
||||
* @param array $error The error data to generate a message from.
|
||||
* @return string The message including the file and line number if available.s
|
||||
*/
|
||||
protected function get_message_from_error( $error ) {
|
||||
$message = $error['message'];
|
||||
|
||||
if ( isset( $error['file'] ) ) {
|
||||
$message .= " in {$error['file']}";
|
||||
|
||||
if ( isset( $error['line'] ) ) {
|
||||
$message .= ":{$error['line']}";
|
||||
}
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the additional context data that will be recorded with the error log entry.
|
||||
* The context includes the action args, a backtrace and any exception messages caught.
|
||||
*
|
||||
* @param ActionScheduler_Action $action The ActionScheduler_Action that failed.
|
||||
* @param int|Exception|array $error The error data that caused the failure.
|
||||
*/
|
||||
protected function get_context_from_action_error( $action, $error ) {
|
||||
$context = [
|
||||
'action_args' => $this->get_action_args_string( $action->get_args() ),
|
||||
];
|
||||
|
||||
if ( is_a( $error, 'Exception' ) ) {
|
||||
// Action scheduler has a nested a try-catch block and so the original caught exception is stored in the previous exception.
|
||||
$previous_exception = $error->getPrevious();
|
||||
$context['error_trace'] = $previous_exception ? $previous_exception->getTraceAsString() : $error->getTraceAsString();
|
||||
}
|
||||
|
||||
// If there is an exception listener and it has caught exceptions, log them for additional debugging.
|
||||
if ( ! empty( $this->exceptions ) ) {
|
||||
foreach ( $this->exceptions as $exception ) {
|
||||
$context['exceptions'][] = $this->get_message_from_exception( $exception );
|
||||
}
|
||||
}
|
||||
|
||||
return $context;
|
||||
}
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ class WCS_My_Account_Payment_Methods {
|
||||
* Allow third-party gateways to override whether the token delete button should be removed.
|
||||
*
|
||||
* Some gateways, like Bambora, don't allow customers to add a new card with the same card number but different expiry or cvv.
|
||||
* This means customers updating their expiring card need to delete the exisitng card first before adding the new one. This
|
||||
* This means customers updating their expiring card need to delete the existing card first before adding the new one. This
|
||||
* isn't possible however because we prevent deleting tokens linked to active subscriptions.
|
||||
*
|
||||
* Gateways can use this filter to make their own checks to allow deletion.
|
||||
|
@@ -17,7 +17,7 @@ class WCS_Post_Meta_Cache_Manager_Many_To_One extends WCS_Post_Meta_Cache_Manage
|
||||
/**
|
||||
* When post meta is updated, check if this class instance cares about updating its cache
|
||||
* to reflect the change. Always pass the previous value, to make sure that any existing
|
||||
* relationships are also deleted because we know the data should not allow realtionships
|
||||
* relationships are also deleted because we know the data should not allow relationships
|
||||
* with multiple other values. e.g. a subscription can only belong to one customer.
|
||||
*
|
||||
* @param int $meta_id The ID of the post meta row in the database.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* A SQL Transaction Handler to assist with starting, commiting and rolling back transactions.
|
||||
* A SQL Transaction Handler to assist with starting, committing and rolling back transactions.
|
||||
* This class also closes off an active transaction before shutdown to allow for shutdown processes to write to the database.
|
||||
*
|
||||
* @package WooCommerce Subscriptions
|
||||
@@ -61,7 +61,7 @@ class WCS_SQL_Transaction {
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a MYSQL Transction.
|
||||
* Starts a MYSQL Transaction.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v3.1.0
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ class WCS_SQL_Transaction {
|
||||
}
|
||||
|
||||
/**
|
||||
* Commits the MYSQL Transction.
|
||||
* Commits the MYSQL Transaction.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v3.1.0
|
||||
*/
|
||||
@@ -81,7 +81,7 @@ class WCS_SQL_Transaction {
|
||||
}
|
||||
|
||||
/**
|
||||
* Rolls back any changes made during the MYSQL Transction.
|
||||
* Rolls back any changes made during the MYSQL Transaction.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v3.1.0
|
||||
*/
|
||||
@@ -93,8 +93,8 @@ class WCS_SQL_Transaction {
|
||||
/**
|
||||
* Closes out an active transaction depending on the type of shutdown.
|
||||
*
|
||||
* Shutdowns caused by a fatal will be rolledback or commited @see $this->on_fatal.
|
||||
* Shutdowns caused by a natural PHP termination (no error) will be rolledback or commited. @see $this->on_shutdown.
|
||||
* Shutdowns caused by a fatal will be rolledback or committed @see $this->on_fatal.
|
||||
* Shutdowns caused by a natural PHP termination (no error) will be rolledback or committed. @see $this->on_shutdown.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v3.1.0
|
||||
*/
|
||||
|
@@ -267,8 +267,8 @@ class WCS_Staging {
|
||||
/**
|
||||
* Gets the sites WordPress or Subscriptions URL.
|
||||
*
|
||||
* WordPress - This is typically the URL the current site is accessable via.
|
||||
* Subscriptions is the URL Subscritpions considers to be the URL to process live payments on. It may differ to the WP URL if the site has moved.
|
||||
* WordPress - This is typically the URL the current site is accessible via.
|
||||
* Subscriptions is the URL Subscriptions considers to be the URL to process live payments on. It may differ to the WP URL if the site has moved.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v4.0.0
|
||||
*
|
||||
|
@@ -364,7 +364,7 @@ class WCS_Template_Loader {
|
||||
* @since 1.4.0
|
||||
*
|
||||
* @param string $template
|
||||
* @param string $tempalte_name
|
||||
* @param string $template_name
|
||||
* @param array $args
|
||||
* @param string $template_path
|
||||
* @param
|
||||
|
@@ -113,6 +113,10 @@ class WCS_Customer_Store_Cached_CPT extends WCS_Customer_Store_CPT implements WC
|
||||
$this->update_subscription_id_cache( $user_id, $subscription_ids );
|
||||
}
|
||||
|
||||
if ( ! is_array( $subscription_ids ) ) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Sort results in order to keep consistency between cached results and queried results.
|
||||
rsort( $subscription_ids );
|
||||
|
||||
|
@@ -216,10 +216,10 @@ class WCS_Subscription_Data_Store_CPT extends WC_Order_Data_Store_CPT implements
|
||||
*/
|
||||
public function update( &$subscription ) {
|
||||
|
||||
// We don't want to call parent here becuase WC_Order_Data_Store_CPT includes a JIT setting of the paid date which is not needed for subscriptions, and also very resource intensive
|
||||
// We don't want to call parent here because WC_Order_Data_Store_CPT includes a JIT setting of the paid date which is not needed for subscriptions, and also very resource intensive
|
||||
Abstract_WC_Order_Data_Store_CPT::update( $subscription );
|
||||
|
||||
// We used to call parent::update() above, which triggered this hook, so we trigger it manually here for backward compatibilty (and to improve compatibility with 3rd party code which may run validation or additional operations on it which should also be applied to a subscription)
|
||||
// We used to call parent::update() above, which triggered this hook, so we trigger it manually here for backward compatibility (and to improve compatibility with 3rd party code which may run validation or additional operations on it which should also be applied to a subscription)
|
||||
do_action( 'woocommerce_update_order', $subscription->get_id(), $subscription );
|
||||
|
||||
do_action( 'woocommerce_update_subscription', $subscription->get_id(), $subscription );
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* When triggering a filter which has a deprecated equivalient from Subscriptions v1.n, check if the old
|
||||
* filter had any callbacks attached to it, and if so, log a notice and trigger the old filter with a set
|
||||
* of parameters in the deprecated format so that the current return value also has the old filters applied
|
||||
* (whereever possible that is).
|
||||
* (wherever possible that is).
|
||||
*
|
||||
* @package WooCommerce Subscriptions
|
||||
* @subpackage WCS_Hook_Deprecator
|
||||
|
@@ -188,7 +188,7 @@ class WCS_PayPal_Reference_Transaction_API_Request {
|
||||
* @link https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/#id094UM0DA0HS
|
||||
* @link https://developer.paypal.com/docs/classic/api/merchant/DoReferenceTransaction_API_Operation_NVP/
|
||||
*
|
||||
* @param string $reference_id the ID of a refrence object, e.g. billing agreement ID.
|
||||
* @param string $reference_id the ID of a reference object, e.g. billing agreement ID.
|
||||
* @param WC_Order $order order object
|
||||
* @param array $args {
|
||||
* @type string 'payment_type' (Optional) Specifies type of PayPal payment you require for the billing agreement. It is one of the following values. 'Any' or 'InstantOnly'. Echeck is not supported for DoReferenceTransaction requests.
|
||||
|
@@ -58,7 +58,7 @@ class WCS_PayPal_Reference_Transaction_API_Response extends WC_Gateway_Paypal_Re
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if response contains an API error code or message relating to invalid credentails
|
||||
* Checks if response contains an API error code or message relating to invalid credentials
|
||||
*
|
||||
* @link https://developer.paypal.com/docs/classic/api/errorcodes/
|
||||
*
|
||||
|
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Performs reference transaction related transactions requests via the PayPal Express Checkout API,
|
||||
* including the creation of a billing agreement and processing renewal payments using that billing
|
||||
* agremeent's ID in a reference tranasction.
|
||||
* agremeent's ID in a reference transaction.
|
||||
*
|
||||
* Also hijacks checkout when PayPal Standard is chosen as the payment method, but Reference Transactions
|
||||
* are enabled on the store's PayPal account, to go via Express Checkout approval flow instead of the
|
||||
|
@@ -570,7 +570,7 @@ class WCS_PayPal_Standard_IPN_Handler extends WC_Gateway_Paypal_IPN_Handler {
|
||||
*
|
||||
* This function expects a generic payload, in any serialization format. It looks for an 'order key' code. This
|
||||
* function uses regular expressions and looks for 'order key'. WooCommerce allows plugins to modify the order
|
||||
* keys through filtering, unfortunatelly we only check for the original
|
||||
* keys through filtering, unfortunately we only check for the original
|
||||
*
|
||||
* @param string $payload PayPal payload data
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying an admin notice to report fatal errors which ocurred while processing PayPal IPNs.
|
||||
* The template for displaying an admin notice to report fatal errors which occurred while processing PayPal IPNs.
|
||||
*
|
||||
* @version 1.0.0 - Migrated from WooCommerce Subscriptions v2.4.0
|
||||
* @var string $last_ipn_error
|
||||
|
@@ -89,7 +89,7 @@ class WC_Product_Subscription_Variation_Legacy extends WC_Product_Subscription_V
|
||||
* WC < 3.0 products have a get_parent() method, but this is not equivalent to the get_parent_id() method
|
||||
* introduced in WC 3.0, because it derives the parent from $this->post->post_parent, but for variations,
|
||||
* $this->post refers to the parent variable object's post, so $this->post->post_parent will be 0 under
|
||||
* normal circumstances. Becuase of that, we can rely on wcs_get_objects_property( $this, 'parent_id' )
|
||||
* normal circumstances. Because of that, we can rely on wcs_get_objects_property( $this, 'parent_id' )
|
||||
* and define this get_parent_id() method for variations even when WC 3.0 is not active.
|
||||
*
|
||||
* @param string $key
|
||||
|
@@ -174,7 +174,7 @@ class WC_Product_Variable_Subscription_Legacy extends WC_Product_Variable_Subscr
|
||||
|
||||
/**
|
||||
* Create unique cache key based on the tax location (affects displayed/cached prices), product version and active price filters.
|
||||
* DEVELOPERS should filter this hash if offering conditonal pricing to keep it unique.
|
||||
* DEVELOPERS should filter this hash if offering conditional pricing to keep it unique.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.2.0
|
||||
* @param WC_Product
|
||||
@@ -208,7 +208,7 @@ class WC_Product_Variable_Subscription_Legacy extends WC_Product_Variable_Subscr
|
||||
}
|
||||
|
||||
/**
|
||||
* Sync variable product prices with the childs lowest/highest prices.
|
||||
* Sync variable product prices with the children lowest/highest prices.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
|
@@ -453,7 +453,7 @@ class WC_Subscription_Legacy extends WC_Subscription {
|
||||
|
||||
/**
|
||||
* Helper function to make sure when WC_Subscription calls get_prop() from
|
||||
* it's new getters that the property is both retreived from the legacy class
|
||||
* it's new getters that the property is both retrieved from the legacy class
|
||||
* property and done so from post meta.
|
||||
*
|
||||
* For inherited dates props, like date_created, date_modified, date_paid,
|
||||
|
@@ -97,7 +97,7 @@ class WCS_Privacy_Background_Updater {
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.2.20
|
||||
* @param int The order ID.
|
||||
* @return bool Wether the order has a scheduled anonymization action.
|
||||
* @return bool Whether the order has a scheduled anonymization action.
|
||||
*/
|
||||
protected function order_anonymization_is_scheduled( $order_id ) {
|
||||
return false !== as_next_scheduled_action( $this->order_anonymization_hook, array( 'order_id' => intval( $order_id ) ) );
|
||||
|
@@ -50,7 +50,7 @@ class WC_Subscriptions_Upgrader {
|
||||
|
||||
$version_out_of_date = version_compare( self::$active_version, WC_Subscriptions_Core_Plugin::instance()->get_library_version(), '<' );
|
||||
|
||||
// Set the cron lock on every request with an out of date version, regardless of authentication level, as we can only lock cron for up to 10 minutes at a time, but we need to keep it locked until the upgrade is complete, regardless of who is browing the site
|
||||
// Set the cron lock on every request with an out of date version, regardless of authentication level, as we can only lock cron for up to 10 minutes at a time, but we need to keep it locked until the upgrade is complete, regardless of who is browsing the site
|
||||
if ( $version_out_of_date ) {
|
||||
self::set_cron_lock();
|
||||
}
|
||||
|
@@ -171,7 +171,7 @@ class WCS_Repair_2_0 {
|
||||
}
|
||||
|
||||
/**
|
||||
* If the subscription does not have a subscription key for whatever reason (probably becuase the product_id was missing), then this one
|
||||
* If the subscription does not have a subscription key for whatever reason (probably because the product_id was missing), then this one
|
||||
* fills in the blank.
|
||||
*
|
||||
* @param array $subscription data about the subscription
|
||||
@@ -601,10 +601,10 @@ class WCS_Repair_2_0 {
|
||||
if ( false === $next_date_timestamp ) {
|
||||
// set it to 0 as default
|
||||
$formatted_date = 0;
|
||||
WCS_Upgrade_Logger::add( sprintf( '-- For order %d: Repairing date type "%s": fetch of date unsuccessfull: no action present. Date is 0.', $subscription['order_id'], $type ) );
|
||||
WCS_Upgrade_Logger::add( sprintf( '-- For order %d: Repairing date type "%s": fetch of date unsuccessful: no action present. Date is 0.', $subscription['order_id'], $type ) );
|
||||
} else {
|
||||
$formatted_date = gmdate( 'Y-m-d H:i:s', $next_date_timestamp );
|
||||
WCS_Upgrade_Logger::add( sprintf( '-- For order %d: Repairing date type "%s": fetch of date successfull. New date is %s', $subscription['order_id'], $type, $formatted_date ) );
|
||||
WCS_Upgrade_Logger::add( sprintf( '-- For order %d: Repairing date type "%s": fetch of date successful. New date is %s', $subscription['order_id'], $type, $formatted_date ) );
|
||||
}
|
||||
|
||||
return $formatted_date;
|
||||
|
@@ -197,8 +197,8 @@ class WCS_Upgrade_1_2 {
|
||||
|
||||
// Base price * Quantity
|
||||
$sign_up_fee_line_subtotal = WC_Subscriptions_Order::get_meta( $order, '_cart_contents_sign_up_fee_total', 0 ) + WC_Subscriptions_Order::get_meta( $order, '_sign_up_fee_discount_cart', 0 );
|
||||
$sign_up_fee_propotion = ( $sign_up_fee_line_total > 0 ) ? $sign_up_fee_line_subtotal / $sign_up_fee_line_total : 0;
|
||||
$sign_up_fee_line_subtotal_tax = WC_Subscriptions_Manager::get_amount_from_proportion( WC_Subscriptions_Order::get_meta( $order, '_sign_up_fee_tax_total', 0 ), $sign_up_fee_propotion );
|
||||
$sign_up_fee_proportion = ( $sign_up_fee_line_total > 0 ) ? $sign_up_fee_line_subtotal / $sign_up_fee_line_total : 0;
|
||||
$sign_up_fee_line_subtotal_tax = WC_Subscriptions_Manager::get_amount_from_proportion( WC_Subscriptions_Order::get_meta( $order, '_sign_up_fee_tax_total', 0 ), $sign_up_fee_proportion );
|
||||
|
||||
if ( $has_trial ) { // Set line item totals equal to sign up fee totals
|
||||
|
||||
|
@@ -858,7 +858,7 @@ class WCS_Upgrade_2_0 {
|
||||
|
||||
/**
|
||||
* The '_switched_subscription_key' and '_switched_subscription_new_order' post meta values are no longer used to relate orders
|
||||
* and switched subscriptions, instead, we need to set a '_subscription_switch' value on the switch order and depreacted the old
|
||||
* and switched subscriptions, instead, we need to set a '_subscription_switch' value on the switch order and deprecated the old
|
||||
* meta keys by prefixing them with '_wcs_migrated'.
|
||||
*
|
||||
* Subscriptions also sets a '_switched_subscription_item_id' value on the new line item of for the switched item and a item meta
|
||||
|
@@ -72,7 +72,7 @@ $settings_page = admin_url( 'admin.php?page=wc-settings&tab=subscriptions' );
|
||||
printf( esc_html__( 'The new interface is also built on the existing %sEdit Order%s screen. If you\'ve ever modified an order, you already know how to modify a subscription.', 'woocommerce-subscriptions' ), '<strong>', '</strong>' ); ?>
|
||||
</p>
|
||||
<p><?php
|
||||
// translators: placeholers are link tags: 1$-2$ new subscription page, 3$-4$: docs on woocommerce.com
|
||||
// translators: placeholders are link tags: 1$-2$ new subscription page, 3$-4$: docs on woocommerce.com
|
||||
printf( esc_html__( '%1$sAdd a subscription%2$s now or %3$slearn more%4$s about the new interface.', 'woocommerce-subscriptions' ), '<a href="' . esc_url( admin_url( 'post-new.php?post_type=shop_subscription' ) ) . '">', '</a>', '<a href="' . esc_url( 'http://docs.woocommerce.com/document/subscriptions/version-2/#section-3' ) . '">', '</a>' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
@@ -628,7 +628,7 @@ function wcs_is_custom_order_tables_data_sync_enabled() {
|
||||
/**
|
||||
* Sets the address on an order or subscription using WC 7.1 functions if they exist.
|
||||
*
|
||||
* For stores pre WC 7.1, use the individual addresss type and key setter i.e. `set_billing_address_1()` method.
|
||||
* For stores pre WC 7.1, use the individual address type and key setter i.e. `set_billing_address_1()` method.
|
||||
*
|
||||
* @since 5.2.0
|
||||
*
|
||||
|
@@ -652,7 +652,7 @@ function wcs_is_datetime_mysql_format( $time ) {
|
||||
* GMT/UTC offset for that timezone, so for example, when 3rd party code has set the servers
|
||||
* timezone using date_default_timezone_set( 'America/Los_Angeles' ) doing something like
|
||||
* gmdate( "Y-m-d H:i:s", strtotime( gmdate( "Y-m-d H:i:s" ) ) ) will actually add 7 hours to
|
||||
* the date even though it is a date in UTC timezone because the timezone wasn't specificed.
|
||||
* the date even though it is a date in UTC timezone because the timezone wasn't specified.
|
||||
*
|
||||
* This makes sure the date is never converted.
|
||||
*
|
||||
|
@@ -117,7 +117,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
// translators: placeholder is trial period validation message if passed an invalid value (e.g. "Trial period can not exceed 4 weeks")
|
||||
'description' => sprintf( _x( 'An optional period of time to wait before charging the first recurring payment. Any sign up fee will still be charged at the outset of the subscription. %s', 'Trial period dropdown\'s description in pricing fields', 'woocommerce-subscriptions' ), self::get_trial_period_validation_message() ),
|
||||
'desc_tip' => true,
|
||||
'value' => WC_Subscriptions_Product::get_trial_period( $variation->get_id() ), // Explicity set value in to ensure backward compatibility
|
||||
'value' => WC_Subscriptions_Product::get_trial_period( $variation->get_id() ), // Explicitly set value in to ensure backward compatibility
|
||||
)
|
||||
);?>
|
||||
</td>
|
||||
|
@@ -51,7 +51,7 @@ global $wp_locale;
|
||||
'options' => $wp_locale->month,
|
||||
'description' => WC_Subscriptions_Synchroniser::$sync_description_year,
|
||||
'desc_tip' => true,
|
||||
'value' => $payment_month, // Explicity set value in to ensure backward compatibility
|
||||
'value' => $payment_month, // Explicitly set value in to ensure backward compatibility
|
||||
) );
|
||||
?>
|
||||
</td>
|
||||
|
@@ -2,7 +2,6 @@
|
||||
/**
|
||||
* Subscription details table
|
||||
*
|
||||
* @author Prospress
|
||||
* @package WooCommerce_Subscription/Templates
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.6.0
|
||||
* @version 1.0.0 - Migrated from WooCommerce Subscriptions v2.6.0
|
||||
@@ -25,15 +24,15 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ( $subscription->get_items() as $item_id => $item ) {
|
||||
$_product = apply_filters( 'woocommerce_subscriptions_order_item_product', $item->get_product(), $item );
|
||||
$_product = apply_filters( 'woocommerce_subscriptions_order_item_product', $item->get_product(), $item );
|
||||
if ( apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
|
||||
?>
|
||||
<tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $subscription ) ); ?>">
|
||||
<?php if ( $allow_item_removal ) : ?>
|
||||
<td class="remove_item">
|
||||
<?php if ( wcs_can_item_be_removed( $item, $subscription ) ) : ?>
|
||||
<?php $confirm_notice = apply_filters( 'woocommerce_subscriptions_order_item_remove_confirmation_text', __( 'Are you sure you want remove this item from your subscription?', 'woocommerce-subscriptions' ), $item, $_product, $subscription );?>
|
||||
<a href="<?php echo esc_url( WCS_Remove_Item::get_remove_url( $subscription->get_id(), $item_id ) );?>" class="remove" onclick="return confirm('<?php printf( esc_html( $confirm_notice ) ); ?>');">×</a>
|
||||
<?php $confirm_notice = apply_filters( 'woocommerce_subscriptions_order_item_remove_confirmation_text', __( 'Are you sure you want to remove this item from your subscription?', 'woocommerce-subscriptions' ), $item, $_product, $subscription ); ?>
|
||||
<a href="<?php echo esc_url( WCS_Remove_Item::get_remove_url( $subscription->get_id(), $item_id ) ); ?>" class="remove" onclick="return confirm('<?php printf( esc_html( $confirm_notice ) ); ?>');">×</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
@@ -53,7 +52,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
* @param int $item_id The subscription line item ID.
|
||||
* @param WC_Order_Item|array $item The subscription line item.
|
||||
* @param WC_Subscription $subscription The subscription.
|
||||
* @param bool $plain_text Wether the item meta is being generated in a plain text context.
|
||||
* @param bool $plain_text Whether the item meta is being generated in a plain text context.
|
||||
*/
|
||||
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $subscription, false );
|
||||
|
||||
@@ -65,7 +64,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
* @param int $item_id The subscription line item ID.
|
||||
* @param WC_Order_Item|array $item The subscription line item.
|
||||
* @param WC_Subscription $subscription The subscription.
|
||||
* @param bool $plain_text Wether the item meta is being generated in a plain text context.
|
||||
* @param bool $plain_text Whether the item meta is being generated in a plain text context.
|
||||
*/
|
||||
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $subscription, false );
|
||||
?>
|
||||
@@ -77,7 +76,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( $subscription->has_status( array( 'completed', 'processing' ) ) && ( $purchase_note = get_post_meta( $_product->id, '_purchase_note', true ) ) ) {
|
||||
$purchase_note = get_post_meta( $_product->get_id(), '_purchase_note', true );
|
||||
if ( $subscription->has_status( array( 'completed', 'processing' ) ) && $purchase_note ) {
|
||||
?>
|
||||
<tr class="product-purchase-note">
|
||||
<td colspan="3"><?php echo wp_kses_post( wpautop( do_shortcode( $purchase_note ) ) ); ?></td>
|
||||
@@ -89,7 +89,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<?php
|
||||
foreach ( $totals as $key => $total ) : ?>
|
||||
foreach ( $totals as $key => $total ) :
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row" <?php echo ( $allow_item_removal ) ? 'colspan="2"' : ''; ?>><?php echo esc_html( $total['label'] ); ?></th>
|
||||
<td><?php echo wp_kses_post( $total['value'] ); ?></td>
|
||||
|
@@ -105,7 +105,7 @@ function wcs_create_subscription( $args = array() ) {
|
||||
$order = ( isset( $args['order_id'] ) ) ? wc_get_order( $args['order_id'] ) : null;
|
||||
|
||||
$default_args = array(
|
||||
'status' => '',
|
||||
'status' => apply_filters( 'woocommerce_default_subscription_status', 'pending' ),
|
||||
'order_id' => 0,
|
||||
'customer_note' => null,
|
||||
'customer_id' => null,
|
||||
@@ -190,12 +190,11 @@ function wcs_create_subscription( $args = array() ) {
|
||||
|
||||
/**
|
||||
* Filter the newly created subscription object.
|
||||
* We need to fetch the subscription from the database as the current object state doesn't match the loaded state.
|
||||
*
|
||||
* @since 1.0.0 - Migrated from WooCommerce Subscriptions v2.2.22
|
||||
* @param WC_Subscription $subscription
|
||||
*/
|
||||
$subscription = apply_filters( 'wcs_created_subscription', wcs_get_subscription( $subscription ) );
|
||||
$subscription = apply_filters( 'wcs_created_subscription', $subscription );
|
||||
|
||||
/**
|
||||
* Triggered after a new subscription is created.
|
||||
|
@@ -6,5 +6,5 @@
|
||||
* Author: Automattic
|
||||
* Author URI: https://woocommerce.com/
|
||||
* Requires WP: 5.6
|
||||
* Version: 7.0.0
|
||||
* Version: 7.1.1
|
||||
*/
|
||||
|
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: Woo Subscriptions
|
||||
* Plugin Name: WooCommerce Subscriptions
|
||||
* Plugin URI: https://www.woocommerce.com/products/woocommerce-subscriptions/
|
||||
* Description: Sell products and services with recurring payments in your WooCommerce Store.
|
||||
* Author: WooCommerce
|
||||
* Author URI: https://woocommerce.com/
|
||||
* Version: 6.2.0
|
||||
* Version: 6.3.1
|
||||
* Requires Plugins: woocommerce
|
||||
*
|
||||
* WC requires at least: 7.7.0
|
||||
* WC tested up to: 8.7.0
|
||||
* WC requires at least: 7.9.0
|
||||
* WC tested up to: 8.9.0
|
||||
* Woo: 27147:6115e6d7e297b623a169fdcf5728b224
|
||||
*
|
||||
* Copyright 2019 WooCommerce
|
||||
@@ -78,7 +78,7 @@ class WC_Subscriptions {
|
||||
public static $plugin_file = __FILE__;
|
||||
|
||||
/** @var string */
|
||||
public static $version = '6.2.0'; // WRCS: DEFINED_VERSION.
|
||||
public static $version = '6.3.1'; // WRCS: DEFINED_VERSION.
|
||||
|
||||
/** @var string */
|
||||
public static $wc_minimum_supported_version = '7.7';
|
||||
|
Reference in New Issue
Block a user