'; // XSS ok.
+ echo '
'; // 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 = '
';
+ $username = ' ';
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 .= '';
// 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' ), '' . date_i18n( _x( 'M j, Y @ G:i', 'used in "Subscription scheduled for "', 'woocommerce-subscriptions' ), wcs_date_to_time( $post->post_date ) ) . ' ' ),
+ 9 => sprintf( __( 'Subscription scheduled for: %1$s.', 'woocommerce-subscriptions' ), '' . date_i18n( _x( 'M j, Y @ G:i', 'used in "Subscription scheduled for "', 'woocommerce-subscriptions' ), strtotime( $theorder->get_date_created() ?? $post->post_date ) ) . ' ' ),
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'] ) ) : ''; ?>
-
- ' . esc_html__( 'None', 'woocommerce-subscriptions' ) ?>
+
+ ' . esc_html__( 'None', 'woocommerce-subscriptions' ); ?>
payment_gateways->get_available_payment_gateways() as $gateway_id => $gateway ) {
- echo '' . esc_html( $gateway->title ) . ' ';
+ echo '' . esc_html( $gateway->title ) . ' ';
}
echo '' . esc_html__( 'Manual Renewal', 'woocommerce-subscriptions' ) . ' ';
?>
-
+ 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 ) );
+ }
+ ?>
__( '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' );
diff --git a/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-product-import-export-manager.php b/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-product-import-export-manager.php
index 5caca28..c6134ef 100644
--- a/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-product-import-export-manager.php
+++ b/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-admin-product-import-export-manager.php
@@ -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
diff --git a/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php b/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php
index 308a54a..17c7e51 100644
--- a/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php
+++ b/vendor/woocommerce/subscriptions-core/includes/admin/class-wcs-wc-admin-manager.php
@@ -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(
diff --git a/vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/views/html-subscription-schedule.php b/vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/views/html-subscription-schedule.php
index 8865305..a7f6569 100644
--- a/vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/views/html-subscription-schedule.php
+++ b/vendor/woocommerce/subscriptions-core/includes/admin/meta-boxes/views/html-subscription-schedule.php
@@ -57,7 +57,7 @@ if ( ! defined( 'ABSPATH' ) ) {
:
can_date_be_updated( $internal_date_key ) ) : ?>
- 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 ?>
+ 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 ?>
get_date_to_display( $internal_date_key ) ); ?>
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-product-variable-subscription.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-product-variable-subscription.php
index 2385d45..364b833 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-product-variable-subscription.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-product-variable-subscription.php
@@ -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
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php
index 673a3f2..02174ab 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php
@@ -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 );
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart-validator.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart-validator.php
index 55a2572..9abe2e2 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart-validator.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-cart-validator.php
@@ -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
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-change-payment-gateway.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-change-payment-gateway.php
index 6662818..28e6842 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-change-payment-gateway.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-change-payment-gateway.php
@@ -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' ),
'',
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-checkout.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-checkout.php
index 393ddeb..9c51df0 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-checkout.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-checkout.php
@@ -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
*
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php
index 1e14df6..c577ede 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-core-plugin.php
@@ -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 );
}
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-coupon.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-coupon.php
index bc51f6a..c0a9699 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-coupon.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-coupon.php
@@ -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+
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-manager.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-manager.php
index 7667b34..f57aed5 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-manager.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-manager.php
@@ -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.
*
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php
index c49b859..893c63f 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-order.php
@@ -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;
}
/**
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php
index a4da83e..cee38c7 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-product.php
@@ -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 ) {
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php
index c34b079..d9c73a5 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-renewal-order.php
@@ -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
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php
index 9f6a468..a92c233 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wc-subscriptions-synchroniser.php
@@ -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.
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-action-scheduler.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-action-scheduler.php
index 5c7333f..7ce9b05 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-action-scheduler.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-action-scheduler.php
@@ -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 ) {
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-initial-payment.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-initial-payment.php
index eb97e53..9697f71 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-initial-payment.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-initial-payment.php
@@ -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();
}
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-renewal.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-renewal.php
index 4cd2b91..bd6c7e0 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-renewal.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-renewal.php
@@ -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;
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-resubscribe.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-resubscribe.php
index d08702e..29e229e 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-resubscribe.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-resubscribe.php
@@ -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' );
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-download-handler.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-download-handler.php
index cdfefcb..94f9fb7 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-download-handler.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-download-handler.php
@@ -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
*
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-failed-scheduled-action-manager.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-failed-scheduled-action-manager.php
index 56d78c2..6c6b71e 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-failed-scheduled-action-manager.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-failed-scheduled-action-manager.php
@@ -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;
+ }
}
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-my-account-payment-methods.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-my-account-payment-methods.php
index 6a4e174..c4556dd 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-my-account-payment-methods.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-my-account-payment-methods.php
@@ -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.
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-post-meta-cache-manager-many-to-one.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-post-meta-cache-manager-many-to-one.php
index 43ed68c..6f3fe85 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-post-meta-cache-manager-many-to-one.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-post-meta-cache-manager-many-to-one.php
@@ -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.
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-sql-transaction.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-sql-transaction.php
index 25b9f86..b182507 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-sql-transaction.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-sql-transaction.php
@@ -1,6 +1,6 @@
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
*/
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-staging.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-staging.php
index 4240137..e9acb3f 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-staging.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-staging.php
@@ -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
*
diff --git a/vendor/woocommerce/subscriptions-core/includes/class-wcs-template-loader.php b/vendor/woocommerce/subscriptions-core/includes/class-wcs-template-loader.php
index b437e64..5b99eec 100644
--- a/vendor/woocommerce/subscriptions-core/includes/class-wcs-template-loader.php
+++ b/vendor/woocommerce/subscriptions-core/includes/class-wcs-template-loader.php
@@ -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
diff --git a/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-customer-store-cached-cpt.php b/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-customer-store-cached-cpt.php
index ee8dab6..1ac9a27 100644
--- a/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-customer-store-cached-cpt.php
+++ b/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-customer-store-cached-cpt.php
@@ -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 );
diff --git a/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-subscription-data-store-cpt.php b/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-subscription-data-store-cpt.php
index 5f3c57c..b28e7a8 100644
--- a/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-subscription-data-store-cpt.php
+++ b/vendor/woocommerce/subscriptions-core/includes/data-stores/class-wcs-subscription-data-store-cpt.php
@@ -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 );
diff --git a/vendor/woocommerce/subscriptions-core/includes/deprecated/class-wcs-filter-deprecator.php b/vendor/woocommerce/subscriptions-core/includes/deprecated/class-wcs-filter-deprecator.php
index 64c9d31..818f069 100644
--- a/vendor/woocommerce/subscriptions-core/includes/deprecated/class-wcs-filter-deprecator.php
+++ b/vendor/woocommerce/subscriptions-core/includes/deprecated/class-wcs-filter-deprecator.php
@@ -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
diff --git a/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-request.php b/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-request.php
index 021d17b..2c710fd 100644
--- a/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-request.php
+++ b/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-request.php
@@ -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.
diff --git a/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response.php b/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response.php
index 03943dc..f14a95d 100644
--- a/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response.php
+++ b/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response.php
@@ -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/
*
diff --git a/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api.php b/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api.php
index 6357f32..8ea3ca6 100644
--- a/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api.php
+++ b/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api.php
@@ -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
diff --git a/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-standard-ipn-handler.php b/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-standard-ipn-handler.php
index b97a827..031b8e8 100644
--- a/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-standard-ipn-handler.php
+++ b/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/class-wcs-paypal-standard-ipn-handler.php
@@ -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
*
diff --git a/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/templates/html-ipn-failure-notice.php b/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/templates/html-ipn-failure-notice.php
index eb713b7..088b3b5 100644
--- a/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/templates/html-ipn-failure-notice.php
+++ b/vendor/woocommerce/subscriptions-core/includes/gateways/paypal/includes/templates/html-ipn-failure-notice.php
@@ -1,6 +1,6 @@
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
diff --git a/vendor/woocommerce/subscriptions-core/includes/legacy/class-wc-product-variable-subscription-legacy.php b/vendor/woocommerce/subscriptions-core/includes/legacy/class-wc-product-variable-subscription-legacy.php
index 623afb6..669412b 100644
--- a/vendor/woocommerce/subscriptions-core/includes/legacy/class-wc-product-variable-subscription-legacy.php
+++ b/vendor/woocommerce/subscriptions-core/includes/legacy/class-wc-product-variable-subscription-legacy.php
@@ -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
diff --git a/vendor/woocommerce/subscriptions-core/includes/legacy/class-wc-subscription-legacy.php b/vendor/woocommerce/subscriptions-core/includes/legacy/class-wc-subscription-legacy.php
index 4a98569..a7baf7c 100644
--- a/vendor/woocommerce/subscriptions-core/includes/legacy/class-wc-subscription-legacy.php
+++ b/vendor/woocommerce/subscriptions-core/includes/legacy/class-wc-subscription-legacy.php
@@ -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,
diff --git a/vendor/woocommerce/subscriptions-core/includes/privacy/class-wcs-privacy-background-updater.php b/vendor/woocommerce/subscriptions-core/includes/privacy/class-wcs-privacy-background-updater.php
index 8018b2c..39b6e23 100644
--- a/vendor/woocommerce/subscriptions-core/includes/privacy/class-wcs-privacy-background-updater.php
+++ b/vendor/woocommerce/subscriptions-core/includes/privacy/class-wcs-privacy-background-updater.php
@@ -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 ) ) );
diff --git a/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wc-subscriptions-upgrader.php b/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wc-subscriptions-upgrader.php
index b310c21..c020d89 100644
--- a/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wc-subscriptions-upgrader.php
+++ b/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wc-subscriptions-upgrader.php
@@ -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();
}
diff --git a/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-repair-2-0.php b/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-repair-2-0.php
index bb619ed..194dc63 100644
--- a/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-repair-2-0.php
+++ b/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-repair-2-0.php
@@ -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;
diff --git a/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-upgrade-1-2.php b/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-upgrade-1-2.php
index c6dfb66..33350c0 100644
--- a/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-upgrade-1-2.php
+++ b/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-upgrade-1-2.php
@@ -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
diff --git a/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-upgrade-2-0.php b/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-upgrade-2-0.php
index c9a7cc3..e95bc79 100644
--- a/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-upgrade-2-0.php
+++ b/vendor/woocommerce/subscriptions-core/includes/upgrades/class-wcs-upgrade-2-0.php
@@ -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
diff --git a/vendor/woocommerce/subscriptions-core/includes/upgrades/templates/wcs-about-2-0.php b/vendor/woocommerce/subscriptions-core/includes/upgrades/templates/wcs-about-2-0.php
index 69216cc..9319e3f 100644
--- a/vendor/woocommerce/subscriptions-core/includes/upgrades/templates/wcs-about-2-0.php
+++ b/vendor/woocommerce/subscriptions-core/includes/upgrades/templates/wcs-about-2-0.php
@@ -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' ), '', ' ' ); ?>
', '
', '
', ' ' ); ?>
diff --git a/vendor/woocommerce/subscriptions-core/includes/wcs-compatibility-functions.php b/vendor/woocommerce/subscriptions-core/includes/wcs-compatibility-functions.php
index 4824f0f..84613c2 100644
--- a/vendor/woocommerce/subscriptions-core/includes/wcs-compatibility-functions.php
+++ b/vendor/woocommerce/subscriptions-core/includes/wcs-compatibility-functions.php
@@ -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
*
diff --git a/vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php b/vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php
index cd918e4..45e6785 100644
--- a/vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php
+++ b/vendor/woocommerce/subscriptions-core/includes/wcs-time-functions.php
@@ -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.
*
diff --git a/vendor/woocommerce/subscriptions-core/templates/admin/deprecated/html-variation-price.php b/vendor/woocommerce/subscriptions-core/templates/admin/deprecated/html-variation-price.php
index 271082b..4a7ae4d 100644
--- a/vendor/woocommerce/subscriptions-core/templates/admin/deprecated/html-variation-price.php
+++ b/vendor/woocommerce/subscriptions-core/templates/admin/deprecated/html-variation-price.php
@@ -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
)
);?>
diff --git a/vendor/woocommerce/subscriptions-core/templates/admin/deprecated/html-variation-synchronisation.php b/vendor/woocommerce/subscriptions-core/templates/admin/deprecated/html-variation-synchronisation.php
index 1daaa11..5256dde 100644
--- a/vendor/woocommerce/subscriptions-core/templates/admin/deprecated/html-variation-synchronisation.php
+++ b/vendor/woocommerce/subscriptions-core/templates/admin/deprecated/html-variation-synchronisation.php
@@ -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
) );
?>
diff --git a/vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-totals-table.php b/vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-totals-table.php
index 427f76f..d33a6a6 100644
--- a/vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-totals-table.php
+++ b/vendor/woocommerce/subscriptions-core/templates/myaccount/subscription-totals-table.php
@@ -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' ) ) {
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 ) ) {
?>
-
- ×
+
+ ×
@@ -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' ) ) {
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 ) {
?>
@@ -89,7 +89,8 @@ if ( ! defined( 'ABSPATH' ) ) {
$total ) : ?>
+ foreach ( $totals as $key => $total ) :
+ ?>
>
diff --git a/vendor/woocommerce/subscriptions-core/wcs-functions.php b/vendor/woocommerce/subscriptions-core/wcs-functions.php
index 67383ce..a7ce6fc 100644
--- a/vendor/woocommerce/subscriptions-core/wcs-functions.php
+++ b/vendor/woocommerce/subscriptions-core/wcs-functions.php
@@ -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.
diff --git a/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php b/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php
index e63d0f9..df15150 100644
--- a/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php
+++ b/vendor/woocommerce/subscriptions-core/woocommerce-subscriptions-core.php
@@ -6,5 +6,5 @@
* Author: Automattic
* Author URI: https://woocommerce.com/
* Requires WP: 5.6
- * Version: 7.0.0
+ * Version: 7.1.1
*/
diff --git a/woocommerce-subscriptions.php b/woocommerce-subscriptions.php
index bc24fbe..3f60f66 100644
--- a/woocommerce-subscriptions.php
+++ b/woocommerce-subscriptions.php
@@ -1,15 +1,15 @@