diff --git a/assets/css/about.css b/assets/css/about.css old mode 100755 new mode 100644 diff --git a/assets/css/admin-order-statuses.css b/assets/css/admin-order-statuses.css old mode 100755 new mode 100644 diff --git a/assets/css/admin.css b/assets/css/admin.css old mode 100755 new mode 100644 index ef377b5..2f6c9ea --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -271,7 +271,8 @@ a.close-subscriptions-search { /* Add/Edit Subscription Screen */ #woocommerce-subscription-data .handlediv, #woocommerce-subscription-data h2.hndle, -#woocommerce-subscription-data h3.hndle { +#woocommerce-subscription-data h3.hndle, +#woocommerce-subscription-data .postbox-header { display: none; } #woocommerce-subscription-data .inside { diff --git a/assets/css/checkout.css b/assets/css/checkout.css old mode 100755 new mode 100644 diff --git a/assets/css/dashboard.css b/assets/css/dashboard.css old mode 100755 new mode 100644 diff --git a/assets/css/modal.css b/assets/css/modal.css old mode 100755 new mode 100644 diff --git a/assets/css/view-subscription.css b/assets/css/view-subscription.css old mode 100755 new mode 100644 diff --git a/assets/css/wcs-upgrade.css b/assets/css/wcs-upgrade.css old mode 100755 new mode 100644 diff --git a/assets/images/add-edit-subscription-screen.png b/assets/images/add-edit-subscription-screen.png old mode 100755 new mode 100644 diff --git a/assets/images/admin-change-payment-method.jpg b/assets/images/admin-change-payment-method.jpg old mode 100755 new mode 100644 diff --git a/assets/images/ajax-loader.gif b/assets/images/ajax-loader.gif old mode 100755 new mode 100644 diff --git a/assets/images/ajax-loader@2x.gif b/assets/images/ajax-loader@2x.gif old mode 100755 new mode 100644 diff --git a/assets/images/billing-schedules-meta-box.png b/assets/images/billing-schedules-meta-box.png old mode 100755 new mode 100644 diff --git a/assets/images/checkout-recurring-totals.png b/assets/images/checkout-recurring-totals.png old mode 100755 new mode 100644 diff --git a/assets/images/drip-downloadable-content.jpg b/assets/images/drip-downloadable-content.jpg old mode 100755 new mode 100644 diff --git a/assets/images/gift-subscription.png b/assets/images/gift-subscription.png old mode 100755 new mode 100644 diff --git a/assets/images/renewal-retry-settings.png b/assets/images/renewal-retry-settings.png old mode 100755 new mode 100644 diff --git a/assets/images/subscribe-all-the-things.png b/assets/images/subscribe-all-the-things.png old mode 100755 new mode 100644 diff --git a/assets/images/subscription-reports.png b/assets/images/subscription-reports.png old mode 100755 new mode 100644 diff --git a/assets/images/subscription-suspended-email.jpg b/assets/images/subscription-suspended-email.jpg old mode 100755 new mode 100644 diff --git a/assets/images/subscriptions-importer-exporter.png b/assets/images/subscriptions-importer-exporter.png old mode 100755 new mode 100644 diff --git a/assets/images/view-subscription.png b/assets/images/view-subscription.png old mode 100755 new mode 100644 diff --git a/assets/images/woocommerce_subscriptions_logo.png b/assets/images/woocommerce_subscriptions_logo.png old mode 100755 new mode 100644 diff --git a/assets/js/admin/admin-pointers.js b/assets/js/admin/admin-pointers.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/admin.js b/assets/js/admin/admin.js old mode 100755 new mode 100644 index f79ceb0..0de3752 --- a/assets/js/admin/admin.js +++ b/assets/js/admin/admin.js @@ -528,15 +528,6 @@ jQuery(document).ready(function($){ } }); - $(window).load(function(){ - if($('[name="contains_subscription"]').length > 0 && $('[name="contains_subscription"]').val()=='true'){ - // Show the Recurring Order Totals meta box in WC 2.2 - $('#woocommerce-order-totals').show(); - } else { - $('#woocommerce-order-totals').hide(); - } - }); - // Editing a variable product $('#variable_product_options').on('change','[name^="variable_regular_price"]',function(){ var matches = $(this).attr('name').match(/\[(.*?)\]/); diff --git a/assets/js/admin/jquery.flot.axislabels.js b/assets/js/admin/jquery.flot.axislabels.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jquery.flot.axislabels.min.js b/assets/js/admin/jquery.flot.axislabels.min.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jquery.flot.orderBars.js b/assets/js/admin/jquery.flot.orderBars.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jquery.flot.orderBars.min.js b/assets/js/admin/jquery.flot.orderBars.min.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jstz.js b/assets/js/admin/jstz.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jstz.min.js b/assets/js/admin/jstz.min.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/meta-boxes-coupon.js b/assets/js/admin/meta-boxes-coupon.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/meta-boxes-subscription.js b/assets/js/admin/meta-boxes-subscription.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/moment.js b/assets/js/admin/moment.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/moment.min.js b/assets/js/admin/moment.min.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/reports.js b/assets/js/admin/reports.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/tracks.js b/assets/js/admin/tracks.js new file mode 100644 index 0000000..4cdf0f2 --- /dev/null +++ b/assets/js/admin/tracks.js @@ -0,0 +1,79 @@ +jQuery( function( $ ) { + + if ( ! window.hasOwnProperty( 'wcTracks' ) ) { + return; + } + + function record_event( eventName, properties = {} ) { + window.wcTracks.recordEvent( eventName, properties ); + } + + // Add event listeners to Subscription Events by Date report clickable filters. + if ( $( "#report_subscription_events_by_date_new" ).length ) { + + var filters = { + 'new': 'subscriptions_report_events_by_date_new_filter_click', + 'signups': 'subscriptions_report_events_by_date_signups_filter_click', + 'resubscribes': 'subscriptions_report_events_by_date_resubscribes_filter_click', + 'renewals': 'subscriptions_report_events_by_date_renewals_filter_click', + 'switches': 'subscriptions_report_events_by_date_switches_filter_click', + 'cancellations': 'subscriptions_report_events_by_date_cancellations_filter_click', + 'ended': 'subscriptions_report_events_by_date_ended_filter_click', + 'current': 'subscriptions_report_events_by_date_current_filter_click', + } + + $.each( filters, function( key, value ) { + $( "#report_subscription_events_by_date_" + key ).on( 'click', function() { + // if range is not a URL param, we are looking at the default 7 day range. + var properties = { + range: location.search.includes( 'range' ) ? location.search.match( /range=([^]*)/ )[1] : '7day' + }; + + if ( 'custom' === properties.range ) { + // Start or end dates may be ommitted. + properties.start_date = location.search.includes( 'start_date=' ) + ? location.search.match( /start_date=([^]*)/ )[1] + : null; + + properties.end_date = location.search.includes( 'end_date=' ) + ? location.search.match( /end_date=([^]*)/ )[1] + : new Date().toISOString().split( 'T' )[0]; + + properties.span = properties.start_date + ? Math.floor( ( new Date( properties.end_date ) - new Date( properties.start_date ) ) / 86400000 ) + 1 + 'day' + : null; + } + + record_event( value, properties ); + } ); + } ); + } + + // Add event listeners to Subscription by Product report links. + if ( $( "tbody[ data-wp-lists='list:product' ]" ).length ) { + + $( "td.product_name a" ).on( 'click', function() { + record_event( 'subscriptions_report_by_product_name_click' ); + } ); + + $( "td.subscription_count a" ).on( 'click', function() { + record_event( 'subscriptions_report_by_product_count_click' ); + } ); + } + + // Add event listeners to Subscription by Customer report links. + if ( $( "tbody[ data-wp-lists='list:customer' ]" ).length ) { + + $( "td.customer_name a" ).on( 'click', function() { + record_event( 'subscriptions_report_by_customer_name_click' ); + } ); + + $( "td.total_subscription_count a" ).on( 'click', function() { + record_event( 'subscriptions_report_by_customer_total_count_click' ); + } ); + + $( "td.total_subscription_order_count a" ).on( 'click', function() { + record_event( 'subscriptions_report_by_customer_total_order_count_click' ); + } ); + } +}); diff --git a/assets/js/admin/wcs-meta-boxes-order.js b/assets/js/admin/wcs-meta-boxes-order.js old mode 100755 new mode 100644 diff --git a/assets/js/frontend/single-product.js b/assets/js/frontend/single-product.js old mode 100755 new mode 100644 diff --git a/assets/js/frontend/view-subscription.js b/assets/js/frontend/view-subscription.js old mode 100755 new mode 100644 diff --git a/assets/js/modal.js b/assets/js/modal.js old mode 100755 new mode 100644 diff --git a/assets/js/wcs-upgrade.js b/assets/js/wcs-upgrade.js old mode 100755 new mode 100644 diff --git a/changelog.txt b/changelog.txt old mode 100755 new mode 100644 index 00cd1ab..74e2ccc --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,84 @@ *** WooCommerce Subscriptions Changelog *** +2020-09-29 - version 3.0.9 +* Fix: Offset subscription next payment date calculations based on site time. All dates still remain in UTC, but calculations on the 1st and last day of the month will now take into account the site timezone. PR#3708 +* Fix: Only attempt to display the customer notice when updating the default token from the My Account page. PR#3799 +* Fix: Prefix variation attributes with `attribute_` when setting up renewal carts. PR#3809 +* Dev: Add a new hook to the change_users_subscription() function - this hook is triggered before the status change. PR#3787 + +2020-09-24 - version 3.0.8 +* Tweak: Remove the '$X now' from price string when synced product sign up date is today. PR#3797 +* Fix: Treat a subscription with a cancelled parent order as "needing payment". This ensures cancelling the subscription will go right to cancelled, rather than pending-cancellation. PR#3784 +* Fix: Remove code responsible for hiding/showing the WC order totals meta box. This fixes the deprecated jQuery.fn.load() warnings. PR#3786 +* Fix: Fix updating status and end dates via the REST API. PR#3796 +* Dev: Add an action hook to edit subscription admin payment meta inputs. Enables third-parties to display custom fields for each gateway. PR#3798 +* Dev: Opt-in tracking data for Subscriptions Reports PR#3738 + Data sent to WooCommerce: + Subscriptions report views + Subscriptions report filter usage - clicks and report range + Number of subscriptions, orders, products + Plugin version + To disable this tracking, opt-out of WooCommerce tracking, see https://woocommerce.com/usage-tracking/ + +2020-08-11 - version 3.0.7 +* Fix: Prevent possible errors caused by inaccessible get_current_screen() function. PR#3678 +* Fix: Decouple single_add_to_cart_text() from add_to_cart_text() and remove double and incorrect filtering. PR#3705 +* Fix: Account for the pre-paid term when canceling a subscription which is on-hold without a required payment. PR#3726 +* Fix: [WC4.4] Replace uses of `get_product_from_item()` with `$item->get_product()`. PR#3769 +* Fix: [WC4.4] Deprecate use of the WC_Cart::tax_display_cart. PR#3741 +* Fix: [WC4.4] Update WC_Product_Variable_Subscription::get_available_variations() function signature. PR#3761 +* Fix: [WC4.0] Use the WC version appropriate hook to override the text explaining uneditable subscriptions. PR#3678 +* Fix: [WP5.5] Add permission callback for the REST statuses endpoint. PR#3765 +* Fix: [WP5.5] Remove the post box header from edit subscription meta boxes #3771 +* Performance: Validate product type changes on large sites to avoid running queries on edit product page loads. PR#3699 +* Tweak: [WC Code Standards] Fixes for i18n-related issues. PR#3757 + +2020-07-29 - version 3.0.6 +* Tweak: Add placeholder explanation for the upcoming recurring report. PR#3655 +* Tweak: Add a link to QuickForget.com in the IPN error notice. PR#3744 +* Fix: Fix COD gateway availability for trial subscriptions. PR#3740 +* Fix: Fetch customer error notice messages on the change payment method page in WC post 3.9 version compatible way. PR#3730 +* Fix: Don't reduce stock for items added to a subscription manually via admin screen. PR#3725 +* Fix: Only display the automatic renewal note in emails when there's a next payment. PR#3679 +* Fix: Use the interval to calculate first payment date for synced products. Fixes an issue that caused a purchase outside the sync grace period to not account for the subscription interval. PR#3303 +* Dev: Add two new action hooks before and after change payment submit button. PR#3718 +* Dev: Add a new helper function wcs_trial_has_passed(). PR#3289 +* Dev: Replace uses of cal_days_in_month() with a date() equivalent. PR#3734 +* Dev: Make various changes to improve coding standards. PRs#3748, #3749, #3753 + +2020-06-16 - version 3.0.5 +* Fix: Ensure the mixed checkout setting correctly prevents mixed carts after customer login. PR#3696 +* Fix: Translate the automatic subscription recurring note in emails. PR#3684 +* Fix: Account for limited coupon use across recurring carts. Fixes an issue which leads to limited coupons applying beyond the limit. PR#3552 +* Fix: Copy the item usage limit to coupons applied to manual renewal carts. PR#3686 +* Dev: Add a filter to control access to the early renewal modal. PR#3675 + +2020-04-28 - version 3.0.4 +* Fix: Save changes to payment method meta on the edit subscription screen. PR#3666 +* Fix: Grant Shop Managers edit capabilities over subscriber users. PR#3669 +* Fix: Remove original item from switched subscription during a multiple line item, different billing schedule switch. PR#3659 +* Fix: Use strict conditionals when comparing results of as_next_scheduled_action. Fixes rescheduling of actions which were ran manually. PR#3661 +* Tweak: To comply with Visa's changes to rules governing free trial subscriptions, add additional subscription details to email templates. PR#3664 + +2020-04-01 - version 3.0.3 +* Fix: Only set the payment method if it has changed via admin edit. PR#3646 +* Fix: Performance issue in WCS_Payment_Tokens::get_subscriptions_from_token. PR#3649 +* Fix: Exclude empty nonce. + +2020-03-11 - version 3.0.2 +* New: Add WC Admin Compatibility. PR#3628 +* Fix: Restore the trial end date after reactivating a subscription which was cancelled. PR#3572 +* Fix: Hide the order again button for orders which contain limited products. PR#3612 +* Fix: Don't show recurring cart taxes when no taxes apply. PR#3633 +* Fix: Prevent autocompleting orders which contain free, simple, non-digital products. PR#3621 +* Fix: Remove redundant double line from customer report query. PR#3640 +* Fix: [PayPal] Modify WC payload regex to account for alphanumeric chars. PR#3629 +* Fix: Hide the free shipping label for free shipping and free local pickup options. PR#3618 +* Fix: Prevent fatal errors when getting price for variable products which aren't synced. PR#3616 +* Fix: Don't send WC core emails for subscription related orders when in Staging mode. PR#3576 +* Fix: Update PayPal settings URL used in admin notices. PR#3617 +* Tweak: Update wording in warning when attempting to change the subscription product type. PR#3623 + 2020.01.17 - version 3.0.1 * Fix: Support multiple modals on the customer's view subscription page. Fixes an issue where preventing the early renewal modal being displayed was preventing all modals on the page from being displayed. PR#3571 * Fix: Silence PHP warning in events by date report caused by empty set of data. PR#3577 diff --git a/includes/abstracts/abstract-wcs-background-repairer.php b/includes/abstracts/abstract-wcs-background-repairer.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-background-updater.php b/includes/abstracts/abstract-wcs-background-updater.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-background-upgrader.php b/includes/abstracts/abstract-wcs-background-upgrader.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-cache-manager.php b/includes/abstracts/abstract-wcs-cache-manager.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-customer-store.php b/includes/abstracts/abstract-wcs-customer-store.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-debug-tool-cache-updater.php b/includes/abstracts/abstract-wcs-debug-tool-cache-updater.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-debug-tool.php b/includes/abstracts/abstract-wcs-debug-tool.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-dynamic-hook-deprecator.php b/includes/abstracts/abstract-wcs-dynamic-hook-deprecator.php old mode 100755 new mode 100644 index 3d744ab..0e14bc3 --- a/includes/abstracts/abstract-wcs-dynamic-hook-deprecator.php +++ b/includes/abstracts/abstract-wcs-dynamic-hook-deprecator.php @@ -2,11 +2,11 @@ /** * Deprecate actions and filters that use a dynamic hook by appending a variable, like a payment gateway's name. * - * @package WooCommerce Subscriptions - * @subpackage WCS_Hook_Deprecator - * @category Class - * @author Prospress - * @since 2.0 + * @package WooCommerce Subscriptions + * @subpackage WCS_Hook_Deprecator + * @category Class + * @author Prospress + * @since 2.0 */ abstract class WCS_Dynamic_Hook_Deprecator extends WCS_Hook_Deprecator { diff --git a/includes/abstracts/abstract-wcs-hook-deprecator.php b/includes/abstracts/abstract-wcs-hook-deprecator.php old mode 100755 new mode 100644 index 58a4cf7..bf562e7 --- a/includes/abstracts/abstract-wcs-hook-deprecator.php +++ b/includes/abstracts/abstract-wcs-hook-deprecator.php @@ -8,11 +8,11 @@ * * This is the base class for handling those deprecated hooks. * - * @package WooCommerce Subscriptions - * @subpackage WCS_Hook_Deprecator - * @category Class - * @author Prospress - * @since 2.0 + * @package WooCommerce Subscriptions + * @subpackage WCS_Hook_Deprecator + * @category Class + * @author Prospress + * @since 2.0 */ abstract class WCS_Hook_Deprecator { @@ -100,7 +100,7 @@ abstract class WCS_Hook_Deprecator { * @since 2.0 */ protected static function get_order( $subscription ) { - return ( false == $subscription->get_parent_id() ) ? $subscription : $subscription->get_parent(); + return ( false == $subscription->get_parent_id() ) ? $subscription : $subscription->get_parent(); } /** diff --git a/includes/abstracts/abstract-wcs-migrator.php b/includes/abstracts/abstract-wcs-migrator.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-related-order-store.php b/includes/abstracts/abstract-wcs-related-order-store.php old mode 100755 new mode 100644 index b7754cd..14e4251 --- a/includes/abstracts/abstract-wcs-related-order-store.php +++ b/includes/abstracts/abstract-wcs-related-order-store.php @@ -144,7 +144,8 @@ abstract class WCS_Related_Order_Store { */ protected function check_relation_type( $relation_type ) { if ( ! isset( self::$relation_type_keys[ $relation_type ] ) ) { - throw new InvalidArgumentException( sprintf( __( 'Invalid relation type: %s. Order relationship type must be one of: %s.', 'woocommerce-subscriptions' ), $relation_type, implode( ', ', $this->get_relation_types() ) ) ); + // translators: 1: relation type, 2: list of valid relation types. + throw new InvalidArgumentException( sprintf( __( 'Invalid relation type: %1$s. Order relationship type must be one of: %2$s.', 'woocommerce-subscriptions' ), $relation_type, implode( ', ', $this->get_relation_types() ) ) ); } } } diff --git a/includes/abstracts/abstract-wcs-retry-store.php b/includes/abstracts/abstract-wcs-retry-store.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-scheduler.php b/includes/abstracts/abstract-wcs-scheduler.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-table-maker.php b/includes/abstracts/abstract-wcs-table-maker.php old mode 100755 new mode 100644 diff --git a/includes/admin/class-wc-subscriptions-admin.php b/includes/admin/class-wc-subscriptions-admin.php old mode 100755 new mode 100644 index 94b12f2..237fe94 --- a/includes/admin/class-wc-subscriptions-admin.php +++ b/includes/admin/class-wc-subscriptions-admin.php @@ -5,11 +5,11 @@ * Adds a Subscription setting tab and saves subscription settings. Adds a Subscriptions Management page. Adds * Welcome messages and pointers to streamline learning process for new users. * - * @package WooCommerce Subscriptions - * @subpackage WC_Subscriptions_Admin - * @category Class - * @author Brent Shepherd - * @since 1.0 + * @package WooCommerce Subscriptions + * @subpackage WC_Subscriptions_Admin + * @category Class + * @author Brent Shepherd + * @since 1.0 */ class WC_Subscriptions_Admin { @@ -88,7 +88,7 @@ class WC_Subscriptions_Admin { // Save variable subscription meta add_action( 'woocommerce_process_product_meta_variable-subscription', __CLASS__ . '::process_product_meta_variable_subscription' ); - add_action( 'woocommerce_save_product_variation', __CLASS__ . '::save_product_variation', 20, 2 ); + add_action( 'woocommerce_save_product_variation', __CLASS__ . '::save_product_variation', 20, 2 ); add_action( 'woocommerce_subscription_pre_update_status', __CLASS__ . '::check_customer_is_set', 10, 3 ); @@ -114,7 +114,7 @@ class WC_Subscriptions_Admin { add_filter( 'posts_where', array( __CLASS__, 'filter_paid_subscription_orders_for_user' ) ); - add_action( 'admin_notices', __CLASS__ . '::display_renewal_filter_notice' ); + add_action( 'admin_notices', __CLASS__ . '::display_renewal_filter_notice' ); add_shortcode( 'subscriptions', __CLASS__ . '::do_subscriptions_shortcode' ); @@ -127,16 +127,21 @@ class WC_Subscriptions_Admin { // Do not display formatted order total on the Edit Order administration screen add_filter( 'woocommerce_get_formatted_order_total', __CLASS__ . '::maybe_remove_formatted_order_total_filter', 0, 2 ); - add_action( 'woocommerce_payment_gateways_settings', __CLASS__ . '::add_recurring_payment_gateway_information', 10 , 1 ); + add_action( 'woocommerce_payment_gateways_settings', __CLASS__ . '::add_recurring_payment_gateway_information', 10, 1 ); // Change text for when order items cannot be edited - add_action( 'woocommerce_admin_order_totals_after_refunded', __CLASS__ . '::maybe_attach_gettext_callback', 10, 1 ); + wcs_add_woocommerce_dependent_action( 'woocommerce_admin_order_totals_after_total', array( __CLASS__, 'maybe_attach_gettext_callback' ), '4.0.0', '>' ); + wcs_add_woocommerce_dependent_action( 'woocommerce_admin_order_totals_after_refunded', array( __CLASS__, 'maybe_attach_gettext_callback' ), '4.0.0', '<' ); + // Unhook gettext callback to prevent extra call impact add_action( 'woocommerce_order_item_add_action_buttons', __CLASS__ . '::maybe_unattach_gettext_callback', 10, 1 ); // Add a reminder on the enable guest checkout setting that subscriptions still require an account add_filter( 'woocommerce_payment_gateways_settings', array( __CLASS__, 'add_guest_checkout_setting_note' ), 10, 1 ); add_filter( 'woocommerce_account_settings', array( __CLASS__, 'add_guest_checkout_setting_note' ), 10, 1 ); + + // Validate the product type change before other product changes are saved. + add_action( 'woocommerce_process_product_meta', array( __CLASS__, 'validate_product_type_change' ), 5 ); } /** @@ -231,7 +236,7 @@ class WC_Subscriptions_Admin { * @return array $query_vars * @since 2.5.1 */ - public static function modify_downloadable_and_virtual_product_queries( $query_vars) { + public static function modify_downloadable_and_virtual_product_queries( $query_vars ) { global $pagenow, $typenow; if ( ! is_admin() || 'edit.php' !== $pagenow || 'product' !== $typenow ) { @@ -283,14 +288,19 @@ class WC_Subscriptions_Admin { // Set month as the default billing period if ( ! $chosen_period = get_post_meta( $post->ID, '_subscription_period', true ) ) { - $chosen_period = 'month'; + $chosen_period = 'month'; } echo '