/**
     * Save simple product subscription-related meta data
     * 
     * @access public
     * @param int $post_id
     * @param bool $variable
     * @return void
     */
    public function wc_hook_woocommerce_process_product_meta($post_id, $variable = false, $loop = null)
    {
        if ($variable) {
            if (empty($_POST['_subscriptio']) || !isset($_POST['_subscriptio'][$loop])) {
                return array('result' => false);
            }
            $_subscriptio = $_POST['_subscriptio'][$loop];
        }
        else if (!empty($_POST['_subscriptio'])) {
            $_subscriptio = $_POST['_subscriptio'];
        }

        // Not a subscription?
        if (!isset($_subscriptio) || $_subscriptio != 'on') {
            delete_post_meta($post_id, '_subscriptio');
            delete_post_meta($post_id, '_subscriptio_price_time_value');
            delete_post_meta($post_id, '_subscriptio_price_time_unit');
            delete_post_meta($post_id, '_subscriptio_free_trial_time_value');
            delete_post_meta($post_id, '_subscriptio_free_trial_time_unit');
            delete_post_meta($post_id, '_subscriptio_max_length_time_value');
            delete_post_meta($post_id, '_subscriptio_max_length_time_unit');
            delete_post_meta($post_id, '_subscriptio_signup_fee');
            return;
        }

        // Mark this product as subscription
        update_post_meta($post_id, '_subscriptio', 'yes');

        // Get time units
        $time_units = Subscriptio::get_time_units();

        // Price period value (how many periods of time (by time unit) the price covers, e.g. price can be for 3 months)
        $_subscriptio_price_time_value = $variable ? $_POST['_subscriptio_price_time_value'][$loop] : $_POST['_subscriptio_price_time_value'];
        $price_period_value = Subscriptio::get_natural_number($_subscriptio_price_time_value);
        update_post_meta($post_id, '_subscriptio_price_time_value', $price_period_value);

        // Price time unit (e.g. a month)
        $_subscriptio_price_time_unit = $variable ? $_POST['_subscriptio_price_time_unit'][$loop] : $_POST['_subscriptio_price_time_unit'];
        $price_time_unit = isset($time_units[$_subscriptio_price_time_unit]) ? $_subscriptio_price_time_unit : array_shift(array_keys($time_units));
        update_post_meta($post_id, '_subscriptio_price_time_unit', $price_time_unit);

        // Get correct trial period field value
        $_subscriptio_free_trial_time_value = $variable ? $_POST['_subscriptio_free_trial_time_value'][$loop] : $_POST['_subscriptio_free_trial_time_value'];

        // Trial period
        if (isset($_subscriptio_free_trial_time_value) && !empty($_subscriptio_free_trial_time_value)) {

            // Free trial period value (how many periods of time (by time unit) the trial period covers, e.g. trial period can be 2 weeks)
            $trial_period_value = Subscriptio::get_natural_number($_subscriptio_free_trial_time_value);
            update_post_meta($post_id, '_subscriptio_free_trial_time_value', $trial_period_value);

            // Free trial time unit
            $_subscriptio_free_trial_time_unit = $variable ? $_POST['_subscriptio_free_trial_time_unit'][$loop] : $_POST['_subscriptio_free_trial_time_unit'];
            $trial_time_unit = isset($time_units[$_subscriptio_free_trial_time_unit]) ? $_subscriptio_free_trial_time_unit : array_shift(array_keys($time_units));
            update_post_meta($post_id, '_subscriptio_free_trial_time_unit', $trial_time_unit);
        }
        else {
            delete_post_meta($post_id, '_subscriptio_free_trial_time_value');
            delete_post_meta($post_id, '_subscriptio_free_trial_time_unit');
        }

        // Get correct maximum length period value
        $_subscriptio_max_length_time_value = $variable ? $_POST['_subscriptio_max_length_time_value'][$loop] : $_POST['_subscriptio_max_length_time_value'];

        // Max length period
        if (isset($_subscriptio_max_length_time_value) && !empty($_subscriptio_max_length_time_value)) {

            // Max subscription length period value (e.g. up to 12 months)
            $length_period_value = Subscriptio::get_natural_number($_subscriptio_max_length_time_value);
            update_post_meta($post_id, '_subscriptio_max_length_time_value', $length_period_value);

            // Max subscription length time unit
            $_subscriptio_max_length_time_unit = $variable ? $_POST['_subscriptio_max_length_time_unit'][$loop] : $_POST['_subscriptio_max_length_time_unit'];
            $length_time_unit = isset($time_units[$_subscriptio_max_length_time_unit]) ? $_subscriptio_max_length_time_unit : array_shift(array_keys($time_units));
            update_post_meta($post_id, '_subscriptio_max_length_time_unit', $length_time_unit);
        }
        else {
            delete_post_meta($post_id, '_subscriptio_max_length_time_value');
            delete_post_meta($post_id, '_subscriptio_max_length_time_unit');
        }

        // Get correct signup fee field value
        $_subscriptio_signup_fee = $variable ? $_POST['_subscriptio_signup_fee'][$loop] : $_POST['_subscriptio_signup_fee'];

        // Signup fee
        if (isset($_subscriptio_signup_fee) && !empty($_subscriptio_signup_fee)) {
            $signup_fee = Subscriptio::get_float_number_as_string($_subscriptio_signup_fee);

            if ($signup_fee != 0) {
                update_post_meta($post_id, '_subscriptio_signup_fee', $signup_fee);
            }
            else {
                delete_post_meta($post_id, '_subscriptio_signup_fee');
            }
        }
        else {
            delete_post_meta($post_id, '_subscriptio_signup_fee');
        }

        return !$variable ? null : array('result' => true);
    }