WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd

This commit is contained in:
Aristeides Stathopoulos 2016-08-27 08:57:05 +03:00
parent 7c589cf7e1
commit f2730eea02
124 changed files with 2 additions and 204 deletions

View File

@ -37,7 +37,6 @@ class WC_HookFinder {
if ( is_array( $files ) && is_array( $found_files ) ) {
$files = array_merge( $files, $found_files );
}
} // End FOREACH Loop
}
return $files;

View File

@ -1474,7 +1474,6 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
if ( 'excl' === $tax_display && $this->get_prices_include_tax() ) {
$subtotal .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
} else {
if ( 'incl' === $tax_display ) {
return '';
@ -1521,7 +1520,6 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
if ( $this->get_shipping_tax() != 0 && $this->get_prices_include_tax() ) {
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_tax_label', '&nbsp;<small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>', $this, $tax_display );
}
} else {
// Show shipping including tax.
@ -1530,7 +1528,6 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
if ( $this->get_shipping_tax() != 0 && ! $this->get_prices_include_tax() ) {
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_tax_label', '&nbsp;<small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>', $this, $tax_display );
}
}
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_shipped_via', '&nbsp;<small class="shipped_via">' . sprintf( __( 'via %s', 'woocommerce' ), $this->get_shipping_method() ) . '</small>', $this );
@ -1609,7 +1606,6 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
'value' => $tax->formatted_amount,
);
}
} else {
$total_rows['tax'] = array(

View File

@ -294,5 +294,4 @@ if ( ! defined( 'ABSPATH' ) ) {
$wpdb->delete( $wpdb->prefix . 'woocommerce_payment_tokenmeta', array( 'payment_token_id' => $this->get_id() ), array( '%d' ) );
do_action( 'woocommerce_payment_token_deleted', $this->get_id(), $this );
}
}

View File

@ -895,9 +895,7 @@ class WC_Product {
$price = $price * $qty;
}
}
} else {
$price = $price * $qty;
}
@ -1010,7 +1008,6 @@ class WC_Product {
$price = apply_filters( 'woocommerce_price_html', $price, $this );
}
} elseif ( $this->get_price() === '' ) {
$price = apply_filters( 'woocommerce_empty_price_html', '', $this );
@ -1274,7 +1271,6 @@ class WC_Product {
} else {
$this->shipping_class = '';
}
}
return $this->shipping_class;
@ -1376,7 +1372,6 @@ class WC_Product {
return $attribute['value'];
}
}
return '';

View File

@ -200,7 +200,6 @@ class WC_Admin_Dashboard {
echo '<p>' . __( 'There are no product reviews yet.', 'woocommerce' ) . '</p>';
}
}
}
endif;

View File

@ -235,7 +235,6 @@ class WC_Admin_Help {
'<p><a href="' . 'https://woocommerce.com/product-category/woocommerce-extensions/?utm_source=helptab&utm_medium=product&utm_content=wcextensions&utm_campaign=woocommerceplugin' . '" target="_blank">' . __( 'Official Extensions', 'woocommerce' ) . '</a></p>'
);
}
}
endif;

View File

@ -178,7 +178,6 @@ class WC_Admin_Menus {
} elseif ( ! in_array( $item, array( 'separator-woocommerce' ) ) ) {
$woocommerce_menu_order[] = $item;
}
}
// Return order

View File

@ -210,7 +210,6 @@ class WC_Admin_Meta_Boxes {
do_action( 'woocommerce_process_' . $post->post_type . '_meta', $post_id, $post );
}
}
}
new WC_Admin_Meta_Boxes();

View File

@ -365,7 +365,6 @@ class WC_Admin_Post_Types {
} else {
echo '<span class="product-type tips simple" data-tip="' . esc_attr__( 'Simple', 'woocommerce' ) . '"></span>';
}
} elseif ( 'variable' == $the_product->product_type ) {
echo '<span class="product-type tips variable" data-tip="' . esc_attr__( 'Variable', 'woocommerce' ) . '"></span>';
} else {
@ -718,7 +717,6 @@ class WC_Admin_Post_Types {
} else {
echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( sprintf( _n( '%d note', '%d notes', $post->comment_count, 'woocommerce' ), $post->comment_count ) ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
}
} else {
echo '<span class="na">&ndash;</span>';
}
@ -1400,7 +1398,6 @@ class WC_Admin_Post_Types {
if ( ! empty( $_REQUEST['_backorders'] ) ) {
update_post_meta( $post_id, '_backorders', wc_clean( $_REQUEST['_backorders'] ) );
}
}
do_action( 'woocommerce_product_bulk_edit_save', $product );
@ -1719,14 +1716,12 @@ class WC_Admin_Post_Types {
) );
}
}
} elseif ( 'shop_coupon' === $typenow ) {
if ( ! empty( $_GET['coupon_type'] ) ) {
$vars['meta_key'] = 'discount_type';
$vars['meta_value'] = wc_clean( $_GET['coupon_type'] );
}
} elseif ( in_array( $typenow, wc_get_order_types( 'order-meta-boxes' ) ) ) {
// Filter the orders by the posted customer.
@ -1954,7 +1949,6 @@ class WC_Admin_Post_Types {
delete_transient( 'woocommerce_processing_order_count' );
wc_delete_shop_order_transients( $id );
}
}
}

View File

@ -802,7 +802,6 @@ class WC_Admin_Settings {
if ( file_exists( $downloads_url . '/.htaccess' ) ) {
unlink( $downloads_url . '/.htaccess' );
}
} else {
// Force method - protect, add rules to the htaccess file

View File

@ -185,7 +185,6 @@ class WC_Admin_Status {
}
}
}
}
return $result;

View File

@ -155,7 +155,6 @@ class WC_Tax_Rate_Importer extends WP_Importer {
WC_Tax::_update_tax_rate_postcodes( $tax_rate_id, wc_clean( $postcode ) );
WC_Tax::_update_tax_rate_cities( $tax_rate_id, wc_clean( $city ) );
}
} else {
$this->import_error( __( 'The CSV is invalid.', 'woocommerce' ) );
}

View File

@ -169,5 +169,4 @@ class WC_Meta_Box_Order_Actions {
public static function set_email_sent_message( $location ) {
return add_query_arg( 'message', 11, $location );
}
}

View File

@ -62,7 +62,6 @@ class WC_Meta_Box_Order_Notes {
</li>
<?php
}
} else {
echo '<li>' . __( 'There are no notes yet.', 'woocommerce' ) . '</li>';
}

View File

@ -685,7 +685,6 @@ class WC_Meta_Box_Product_Data {
foreach ( $post_terms as $term ) {
echo '<option ' . selected( $variation_selected_value, $term->slug, false ) . ' value="' . esc_attr( $term->slug ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name ) ) . '</option>';
}
} else {
$options = wc_get_text_attributes( $attribute['value'] );
@ -693,7 +692,6 @@ class WC_Meta_Box_Product_Data {
$selected = sanitize_title( $variation_selected_value ) === $variation_selected_value ? selected( $variation_selected_value, sanitize_title( $option ), false ) : selected( $variation_selected_value, $option, false );
echo '<option ' . $selected . ' value="' . esc_attr( $option ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
}
}
echo '</select>';
@ -859,7 +857,6 @@ class WC_Meta_Box_Product_Data {
if ( isset( $_POST['_height'] ) ) {
update_post_meta( $post_id, '_height', ( '' === $_POST['_height'] ) ? '' : wc_format_decimal( $_POST['_height'] ) );
}
} else {
update_post_meta( $post_id, '_weight', '' );
update_post_meta( $post_id, '_length', '' );
@ -973,7 +970,6 @@ class WC_Meta_Box_Product_Data {
'is_taxonomy' => $is_taxonomy,
);
}
} elseif ( isset( $attribute_values[ $i ] ) ) {
// Text based, possibly separated by pipes (WC_DELIMITER). Preserve line breaks in non-variation attributes.
@ -1126,7 +1122,6 @@ class WC_Meta_Box_Product_Data {
$manage_stock = 'yes';
$backorders = wc_clean( $_POST['_backorders'] );
}
} elseif ( 'grouped' !== $product_type && ! empty( $_POST['_manage_stock'] ) ) {
$manage_stock = 'yes';
$backorders = wc_clean( $_POST['_backorders'] );
@ -1144,7 +1139,6 @@ class WC_Meta_Box_Product_Data {
} else {
update_post_meta( $post_id, '_stock', '' );
}
} elseif ( 'variable' !== $product_type ) {
wc_update_product_stock_status( $post_id, wc_clean( $_POST['_stock_status'] ) );
}

View File

@ -38,5 +38,4 @@ class WC_Meta_Box_Product_Short_Description {
wp_editor( htmlspecialchars_decode( $post->post_excerpt ), 'excerpt', apply_filters( 'woocommerce_product_short_description_editor_settings', $settings ) );
}
}

View File

@ -40,7 +40,6 @@ extract( $variation_data );
foreach ( $post_terms as $term ) {
echo '<option ' . selected( $variation_selected_value, $term->slug, false ) . ' value="' . esc_attr( $term->slug ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name ) ) . '</option>';
}
} else {
$options = wc_get_text_attributes( $attribute['value'] );
@ -49,7 +48,6 @@ extract( $variation_data );
$selected = sanitize_title( $variation_selected_value ) === $variation_selected_value ? selected( $variation_selected_value, sanitize_title( $option ), false ) : selected( $variation_selected_value, $option, false );
echo '<option ' . $selected . ' value="' . esc_attr( $option ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
}
}
echo '</select>';

View File

@ -255,7 +255,6 @@ class WC_Settings_General extends WC_Settings_Page {
WC_Admin_Settings::save_fields( $settings );
}
}
endif;

View File

@ -1007,7 +1007,6 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'is_taxonomy' => 1,
);
}
} elseif ( isset( $attribute['options'] ) ) {
// Array based.
if ( is_array( $attribute['options'] ) ) {
@ -1191,7 +1190,6 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
wc_update_product_stock_status( $product->id, $stock_status );
}
} elseif ( 'variable' !== $product_type ) {
wc_update_product_stock_status( $product->id, $stock_status );
}

View File

@ -264,7 +264,6 @@ class WC_REST_Report_Sales_Controller extends WC_REST_Controller {
// Default custom range to today.
$_GET['start_date'] = $_GET['end_date'] = date( 'Y-m-d', current_time( 'timestamp' ) );
}
} else {
$filter['period'] = empty( $filter['period'] ) ? 'week' : $filter['period'];

View File

@ -217,5 +217,4 @@ class WC_REST_Shipping_Methods_Controller extends WC_REST_Controller {
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
);
}
}

View File

@ -817,5 +817,4 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
);
}
}

View File

@ -430,5 +430,4 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
return array( 'success' => $ran, 'message' => $message );
}
}

View File

@ -241,5 +241,4 @@ class WC_API_Coupons extends WC_API_Resource {
return new WP_Query( $query_args );
}
}

View File

@ -500,5 +500,4 @@ class WC_API_Customers extends WC_API_Resource {
return current_user_can( 'list_users' );
}
}

View File

@ -76,5 +76,4 @@ class WC_API_JSON_Handler implements WC_API_Handler {
return json_encode( $data );
}
}

View File

@ -388,5 +388,4 @@ class WC_API_Orders extends WC_API_Resource {
return $subtotal;
}
}

View File

@ -417,7 +417,6 @@ class WC_API_Products extends WC_API_Resource {
// otherwise use the parent product featured image if set
$attachment_ids[] = get_post_thumbnail_id( $product->id );
}
} else {
// add featured image
@ -509,7 +508,6 @@ class WC_API_Products extends WC_API_Resource {
'option' => $attribute,
);
}
} else {
foreach ( $product->get_attributes() as $attribute ) {
@ -551,5 +549,4 @@ class WC_API_Products extends WC_API_Resource {
return $downloads;
}
}

View File

@ -436,7 +436,6 @@ class WC_API_Reports extends WC_API_Resource {
// default custom range to today
$_GET['start_date'] = $_GET['end_date'] = date( 'Y-m-d', current_time( 'timestamp' ) );
}
} else {
// ensure period is valid

View File

@ -220,7 +220,6 @@ class WC_API_Resource {
$data[ $meta_name ][ $meta_key ] = maybe_unserialize( $meta_value[0] );
}
}
}
return $data;
@ -268,7 +267,6 @@ class WC_API_Resource {
unset( $data[ $data_field ][ $sub_field ] );
}
}
} else {
// remove non-matching top-level fields
@ -398,5 +396,4 @@ class WC_API_Resource {
else
return false;
}
}

View File

@ -687,7 +687,6 @@ class WC_API_Server {
if ( $convert_to_utc ) {
$date->modify( -1 * $date->getOffset() . ' seconds' );
}
} catch ( Exception $e ) {
$date = new DateTime( '@0' );

View File

@ -154,7 +154,6 @@ class WC_API_XML_Handler implements WC_API_Handler {
$this->xml->endElement();
}
} else {
// start root element
@ -168,7 +167,6 @@ class WC_API_XML_Handler implements WC_API_Handler {
// end root element
$this->xml->endElement();
}
} else {
// handle single elements
@ -189,7 +187,6 @@ class WC_API_XML_Handler implements WC_API_Handler {
$this->xml->writeElement( $element_key, $element_value );
}
}
return;
@ -308,5 +305,4 @@ class WC_API_XML_Handler implements WC_API_Handler {
return $data;
}
}

View File

@ -75,5 +75,4 @@ class WC_API_JSON_Handler implements WC_API_Handler {
return json_encode( $data );
}
}

View File

@ -1023,7 +1023,6 @@ class WC_API_Orders extends WC_API_Resource {
if ( ! $shipping_id ) {
throw new WC_API_Exception( 'woocommerce_cannot_create_shipping', __( 'Cannot create shipping method, try again', 'woocommerce' ), 500 );
}
} else {
$item = new WC_Order_Item_Shipping( $shipping['id'] );
@ -1094,7 +1093,6 @@ class WC_API_Orders extends WC_API_Resource {
if ( ! $fee_id ) {
throw new WC_API_Exception( 'woocommerce_cannot_create_fee', __( 'Cannot create fee, try again', 'woocommerce' ), 500 );
}
} else {
$item = new WC_Order_Item_Fee( $fee['id'] );
@ -1157,7 +1155,6 @@ class WC_API_Orders extends WC_API_Resource {
if ( ! $coupon_id ) {
throw new WC_API_Exception( 'woocommerce_cannot_create_order_coupon', __( 'Cannot create coupon, try again', 'woocommerce' ), 500 );
}
} else {
$item = new WC_Order_Item_Coupon( $coupon['id'] );

View File

@ -943,7 +943,6 @@ class WC_API_Products extends WC_API_Resource {
'is_taxonomy' => $is_taxonomy,
);
}
} elseif ( isset( $attribute['options'] ) ) {
// Array based
if ( is_array( $attribute['options'] ) ) {
@ -1132,7 +1131,6 @@ class WC_API_Products extends WC_API_Resource {
wc_update_product_stock_status( $product_id, $stock_status );
}
} elseif ( 'variable' !== $product_type ) {
wc_update_product_stock_status( $product_id, $stock_status );
}
@ -1687,7 +1685,6 @@ class WC_API_Products extends WC_API_Resource {
// Otherwise use the parent product featured image if set
$attachment_ids[] = get_post_thumbnail_id( $product->id );
}
} else {
// Add featured image
@ -1947,7 +1944,6 @@ class WC_API_Products extends WC_API_Resource {
'option' => $attribute,
);
}
} else {
foreach ( $product->get_attributes() as $attribute ) {

View File

@ -286,7 +286,6 @@ class WC_API_Reports extends WC_API_Resource {
// default custom range to today
$_GET['start_date'] = $_GET['end_date'] = date( 'Y-m-d', current_time( 'timestamp' ) );
}
} else {
// ensure period is valid

View File

@ -288,7 +288,6 @@ class WC_API_Resource {
$data[ $meta_name ][ $meta_key ] = maybe_unserialize( $meta_value[0] );
}
}
}
return $data;
@ -337,7 +336,6 @@ class WC_API_Resource {
unset( $data[ $data_field ][ $sub_field ] );
}
}
} else {
// remove non-matching top-level fields
@ -376,7 +374,6 @@ class WC_API_Resource {
} else {
return new WP_Error( 'woocommerce_api_cannot_delete_customer', __( 'The customer cannot be deleted', 'woocommerce' ), array( 'status' => 500 ) );
}
} else {
// delete order/coupon/webhook
@ -468,5 +465,4 @@ class WC_API_Resource {
return false;
}
}
}

View File

@ -724,7 +724,6 @@ class WC_API_Server {
if ( $convert_to_utc ) {
$date->modify( -1 * $date->getOffset() . ' seconds' );
}
} catch ( Exception $e ) {
$date = new DateTime( '@0' );
@ -755,5 +754,4 @@ class WC_API_Server {
return $headers;
}
}

View File

@ -458,5 +458,4 @@ class WC_API_Webhooks extends WC_API_Resource {
return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
}
}
}

View File

@ -75,5 +75,4 @@ class WC_API_JSON_Handler implements WC_API_Handler {
return json_encode( $data );
}
}

View File

@ -1068,7 +1068,6 @@ class WC_API_Orders extends WC_API_Resource {
if ( ! $shipping_id ) {
throw new WC_API_Exception( 'woocommerce_cannot_create_shipping', __( 'Cannot create shipping method, try again', 'woocommerce' ), 500 );
}
} else {
$item = new WC_Order_Item_Shipping( $shipping['id'] );
@ -1139,7 +1138,6 @@ class WC_API_Orders extends WC_API_Resource {
if ( ! $fee_id ) {
throw new WC_API_Exception( 'woocommerce_cannot_create_fee', __( 'Cannot create fee, try again', 'woocommerce' ), 500 );
}
} else {
$item = new WC_Order_Item_Fee( $fee['id'] );
@ -1202,7 +1200,6 @@ class WC_API_Orders extends WC_API_Resource {
if ( ! $coupon_id ) {
throw new WC_API_Exception( 'woocommerce_cannot_create_order_coupon', __( 'Cannot create coupon, try again', 'woocommerce' ), 500 );
}
} else {
$item = new WC_Order_Item_Coupon( $coupon['id'] );

View File

@ -1428,7 +1428,6 @@ class WC_API_Products extends WC_API_Resource {
'is_taxonomy' => $is_taxonomy,
);
}
} elseif ( isset( $attribute['options'] ) ) {
// Array based.
if ( is_array( $attribute['options'] ) ) {
@ -1622,7 +1621,6 @@ class WC_API_Products extends WC_API_Resource {
wc_update_product_stock_status( $product_id, $stock_status );
}
} elseif ( 'variable' !== $product_type ) {
wc_update_product_stock_status( $product_id, $stock_status );
}
@ -2209,7 +2207,6 @@ class WC_API_Products extends WC_API_Resource {
// Otherwise use the parent product featured image if set
$attachment_ids[] = get_post_thumbnail_id( $product->id );
}
} else {
// Add featured image
@ -2528,7 +2525,6 @@ class WC_API_Products extends WC_API_Resource {
'option' => $attribute,
);
}
} else {
foreach ( $product->get_attributes() as $attribute ) {

View File

@ -286,7 +286,6 @@ class WC_API_Reports extends WC_API_Resource {
// default custom range to today
$_GET['start_date'] = $_GET['end_date'] = date( 'Y-m-d', current_time( 'timestamp' ) );
}
} else {
// ensure period is valid

View File

@ -290,7 +290,6 @@ class WC_API_Resource {
$data[ $meta_name ][ $meta_key ] = maybe_unserialize( $meta_value[0] );
}
}
}
return $data;
@ -339,7 +338,6 @@ class WC_API_Resource {
unset( $data[ $data_field ][ $sub_field ] );
}
}
} else {
// remove non-matching top-level fields
@ -471,5 +469,4 @@ class WC_API_Resource {
return apply_filters( 'woocommerce_api_check_permission', $permission, $context, $post, $post_type );
}
}

View File

@ -730,7 +730,6 @@ class WC_API_Server {
if ( $convert_to_utc ) {
$date->modify( -1 * $date->getOffset() . ' seconds' );
}
} catch ( Exception $e ) {
$date = new DateTime( '@0' );
@ -761,5 +760,4 @@ class WC_API_Server {
return $headers;
}
}

View File

@ -461,5 +461,4 @@ class WC_API_Webhooks extends WC_API_Resource {
return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
}
}
}

View File

@ -728,7 +728,6 @@ class WC_AJAX {
'is_taxonomy' => $is_taxonomy,
);
}
} elseif ( isset( $attribute_values[ $i ] ) ) {
// Text based, possibly separated by pipes (WC_DELIMITER). Preserve line breaks in non-variation attributes.
@ -745,7 +744,6 @@ class WC_AJAX {
'is_taxonomy' => $is_taxonomy,
);
}
}
}
@ -1939,7 +1937,6 @@ class WC_AJAX {
$new_pos[ $post->ID ] = $menu_order;
$menu_order++;
}
}
do_action( 'woocommerce_after_product_ordering' );

View File

@ -231,5 +231,4 @@ class WC_API extends WC_Legacy_API {
new WC_Register_WP_Admin_Settings( $page );
}
}
}

View File

@ -1614,7 +1614,6 @@ class WC_Cart {
return $return;
}
} else {
return __( 'Free!', 'woocommerce' );
}
@ -2098,7 +2097,6 @@ class WC_Cart {
if ( $this->tax_total > 0 && $this->prices_include_tax ) {
$cart_subtotal .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
} else {
$cart_subtotal = wc_price( $this->subtotal );
@ -2106,7 +2104,6 @@ class WC_Cart {
if ( $this->tax_total > 0 && !$this->prices_include_tax ) {
$cart_subtotal .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
}
}
}
@ -2156,7 +2153,6 @@ class WC_Cart {
if ( $this->prices_include_tax && $this->tax_total > 0 ) {
$product_subtotal .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
} else {
$row_price = $_product->get_price_including_tax( $quantity );
@ -2165,7 +2161,6 @@ class WC_Cart {
if ( ! $this->prices_include_tax && $this->tax_total > 0 ) {
$product_subtotal .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
}
}
// Non-taxable

View File

@ -558,7 +558,6 @@ class WC_Checkout {
if ( isset( $this->posted['shipping_postcode'] ) ) {
WC()->customer->set_shipping_postcode( $this->posted['shipping_postcode'] );
}
} else {
// Update customer location to posted location so we can correctly check available shipping methods
@ -571,7 +570,6 @@ class WC_Checkout {
if ( isset( $this->posted['billing_postcode'] ) ) {
WC()->customer->set_shipping_postcode( $this->posted['billing_postcode'] );
}
}
WC()->customer->save();
@ -696,9 +694,7 @@ class WC_Checkout {
wp_redirect( $result['redirect'] );
exit;
}
}
} else {
if ( empty( $order ) ) {
@ -726,11 +722,8 @@ class WC_Checkout {
);
exit;
}
}
}
} catch ( Exception $e ) {
if ( ! empty( $e ) ) {
wc_add_notice( $e->getMessage(), 'error' );

View File

@ -1183,5 +1183,4 @@ class WC_Customer extends WC_Legacy_Customer {
}
WC()->session->set( 'customer', $data );
}
}

View File

@ -419,7 +419,6 @@ class WC_Emails {
echo $field['label'] . ': ' . $field['value'] . "\n";
}
}
} else {
foreach ( $fields as $field ) {

View File

@ -349,7 +349,6 @@ class WC_Form_Handler {
exit;
}
}
} else {
// No payment was required for order
$order->payment_complete();
@ -360,7 +359,6 @@ class WC_Form_Handler {
do_action( 'woocommerce_after_pay_action', $order );
}
}
}
@ -387,9 +385,7 @@ class WC_Form_Handler {
wp_redirect( $result['redirect'] );
exit();
}
}
}
}
@ -558,7 +554,6 @@ class WC_Form_Handler {
WC()->cart->set_quantity( $cart_item_key, $quantity, false );
$cart_updated = true;
}
}
}
@ -787,7 +782,6 @@ class WC_Form_Handler {
wc_add_to_cart_message( $added_to_cart );
return true;
}
} elseif ( $product_id ) {
/* Link on product archives */
wc_add_notice( __( 'Please choose a product to add to your cart&hellip;', 'woocommerce' ), 'error' );
@ -842,7 +836,6 @@ class WC_Form_Handler {
$variations[ $taxonomy ] = $value;
continue;
}
} else {
$missing_attributes[] = wc_attribute_label( $attribute['name'] );
}
@ -903,7 +896,6 @@ class WC_Form_Handler {
} else {
throw new Exception( '<strong>' . __( 'Error', 'woocommerce' ) . ':</strong> ' . __( 'A user could not be found with this email address.', 'woocommerce' ) );
}
} else {
$creds['user_login'] = $username;
}
@ -937,7 +929,6 @@ class WC_Form_Handler {
wp_redirect( apply_filters( 'woocommerce_login_redirect', $redirect, $user ) );
exit;
}
} catch ( Exception $e ) {
wc_add_notice( apply_filters('login_errors', $e->getMessage() ), 'error' );
}

View File

@ -1016,7 +1016,6 @@ CREATE TABLE {$wpdb->prefix}woocommerce_termmeta (
if ( is_wp_error( $result ) ) {
throw new Exception( $result->get_error_message() );
}
} catch ( Exception $e ) {
WC_Admin_Notices::add_custom_notice(
$plugin_to_install_id . '_install_error',

View File

@ -148,5 +148,4 @@ class WC_Logger {
return $removed;
}
}

View File

@ -241,5 +241,4 @@ class WC_Payment_Tokens {
) );
return $type;
}
}

View File

@ -99,13 +99,11 @@ class WC_Product_Grouped extends WC_Product {
$is_on_sale = true;
}
}
} else {
if ( $this->sale_price && $this->sale_price == $this->price ) {
$is_on_sale = true;
}
}
return apply_filters( 'woocommerce_product_is_on_sale', $is_on_sale, $this );

View File

@ -125,7 +125,6 @@ class WC_Product_Variation extends WC_Product {
if ( '' === $value ) {
$value = $this->variation_level_meta_data[ $key ];
}
} elseif ( in_array( $key, array_keys( $this->variation_inherited_meta_data ) ) ) {
$value = metadata_exists( 'post', $this->variation_id, '_' . $key ) ? get_post_meta( $this->variation_id, '_' . $key, true ) : get_post_meta( $this->id, '_' . $key, true );
@ -138,7 +137,6 @@ class WC_Product_Variation extends WC_Product {
if ( '' === $value ) {
$value = $this->variation_inherited_meta_data[ $key ];
}
} elseif ( 'variation_data' === $key ) {
return $this->variation_data = wc_get_product_variation_attributes( $this->variation_id );
@ -653,7 +651,6 @@ class WC_Product_Variation extends WC_Product {
$description_value = esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name ) );
}
}
} else {
$options = wc_get_text_attributes( $attribute['value'] );

View File

@ -56,7 +56,6 @@ class WC_Session_Handler extends WC_Session {
$this->set_session_expiration();
$this->update_session_timestamp( $this->_customer_id, $this->_session_expiration );
}
} else {
$this->set_session_expiration();
$this->_customer_id = $this->generate_customer_id();

View File

@ -507,5 +507,4 @@ class WC_Shipping_Zone extends WC_Data {
return true;
}
}

View File

@ -828,5 +828,4 @@ class WC_Webhook {
public function get_post_data() {
return $this->post_data;
}
}

View File

@ -225,7 +225,6 @@ class WC_CLI_Command extends WP_CLI_Command {
if ( $convert_to_utc ) {
$date->modify( -1 * $date->getOffset() . ' seconds' );
}
} catch ( Exception $e ) {
$date = new DateTime( '@0' );
}

View File

@ -995,7 +995,6 @@ class WC_CLI_Order extends WC_CLI_Command {
if ( ! $item_id ) {
throw new WC_CLI_Exception( 'woocommerce_cannot_create_line_item', __( 'Cannot create line item, try again', 'woocommerce' ) );
}
} else {
$item_id = $order->update_product( $item['id'], $product, $item_args );
@ -1092,7 +1091,6 @@ class WC_CLI_Order extends WC_CLI_Command {
if ( ! $shipping_id ) {
throw new WC_CLI_Exception( 'woocommerce_cannot_create_shipping', __( 'Cannot create shipping method, try again', 'woocommerce' ) );
}
} else {
$shipping_args = array();
@ -1169,7 +1167,6 @@ class WC_CLI_Order extends WC_CLI_Command {
if ( ! $fee_id ) {
throw new WC_CLI_Exception( 'woocommerce_cannot_create_fee', __( 'Cannot create fee, try again', 'woocommerce' ) );
}
} else {
$fee_args = array();
@ -1226,7 +1223,6 @@ class WC_CLI_Order extends WC_CLI_Command {
if ( ! $coupon_id ) {
throw new WC_CLI_Exception( 'woocommerce_cannot_create_order_coupon', __( 'Cannot create coupon, try again', 'woocommerce' ) );
}
} else {
$coupon_args = array();

View File

@ -872,7 +872,6 @@ class WC_CLI_Product extends WC_CLI_Command {
// Otherwise use the parent product featured image if set
$attachment_ids[] = get_post_thumbnail_id( $product->id );
}
} else {
// Add featured image
@ -950,7 +949,6 @@ class WC_CLI_Product extends WC_CLI_Command {
'option' => $attribute,
);
}
} else {
foreach ( $product->get_attributes() as $attribute ) {
@ -1195,7 +1193,6 @@ class WC_CLI_Product extends WC_CLI_Command {
'is_taxonomy' => $is_taxonomy,
);
}
} elseif ( isset( $attribute['options'] ) ) {
// Array based
if ( is_array( $attribute['options'] ) ) {
@ -1405,7 +1402,6 @@ class WC_CLI_Product extends WC_CLI_Command {
wc_update_product_stock_status( $product_id, $stock_status );
}
} else {
wc_update_product_stock_status( $product_id, $stock_status );
}

View File

@ -340,7 +340,6 @@ class WC_CLI_Report extends WC_CLI_Command {
// default custom range to today
$_GET['start_date'] = $_GET['end_date'] = date( 'Y-m-d', current_time( 'timestamp' ) );
}
} else {
// ensure period is valid

View File

@ -89,5 +89,4 @@ class WC_Payment_Gateway_CC extends WC_Payment_Gateway {
echo '<fieldset>' . $cvc_field . '</fieldset>';
}
}
}

View File

@ -60,5 +60,4 @@ class WC_Payment_Gateway_eCheck extends WC_Payment_Gateway {
<div class="clear"></div>
</fieldset><?php
}
}

View File

@ -161,7 +161,6 @@ class WC_Gateway_COD extends WC_Payment_Gateway {
if ( $order->shipping_method ) {
$check_method = $order->shipping_method;
}
} elseif ( empty( $chosen_shipping_methods ) || sizeof( $chosen_shipping_methods ) > 1 ) {
$check_method = false;
} elseif ( sizeof( $chosen_shipping_methods ) == 1 ) {

View File

@ -190,7 +190,6 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
// Log paypal transaction fee.
update_post_meta( $order->get_id(), 'PayPal Transaction Fee', wc_clean( $posted['mc_fee'] ) );
}
} else {
if ( 'authorization' === $posted['pending_reason'] ) {
$this->payment_on_hold( $order, __( 'Payment authorized. Change payment status to processing or complete to capture funds.', 'woocommerce' ) );

View File

@ -130,7 +130,6 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
'redirect' => $this->get_return_url( $order ),
);
}
} catch ( Simplify_ApiException $e ) {
if ( $e instanceof Simplify_BadRequestException && $e->hasFieldErrors() && $e->getFieldErrors() ) {
foreach ( $e->getFieldErrors() as $error ) {

View File

@ -463,7 +463,6 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway_CC {
'redirect' => $this->get_return_url( $order ),
);
}
} catch ( Simplify_ApiException $e ) {
if ( $e instanceof Simplify_BadRequestException && $e->hasFieldErrors() && $e->getFieldErrors() ) {
foreach ( $e->getFieldErrors() as $error ) {
@ -729,7 +728,6 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway_CC {
} else {
throw new Simplify_ApiException( __( 'Refund was declined.', 'woocommerce' ) );
}
} catch ( Simplify_ApiException $e ) {
if ( $e instanceof Simplify_BadRequestException && $e->hasFieldErrors() && $e->getFieldErrors() ) {
foreach ( $e->getFieldErrors() as $error ) {

View File

@ -181,5 +181,4 @@ abstract class WC_Legacy_Coupon extends WC_Data {
_deprecated_function( 'exclude_sale_items', '2.7', 'get_exclude_sale_items' );
return $this->get_exclude_sale_items();
}
}

View File

@ -249,5 +249,4 @@ abstract class WC_Legacy_Customer extends WC_Data {
_deprecated_function( 'WC_Customer::set_address_2', '2.7', 'WC_Customer::set_billing_address_2' );
$this->set_billing_address_2( $address );
}
}

View File

@ -214,7 +214,6 @@ if ( ! class_exists( 'WC_Eval_Math' ) ) {
while ( substr( $expr, $index, 1 ) == ' ' ) { // step the index past whitespace (pretty much turns whitespace
$index++; // into implicit multiplication if no operator is there)
}
}
while ( !is_null( $op = $stack->pop() ) ) { // pop everything off the stack and push onto output
if ( $op == '(' ) return self::trigger( "expecting ')'" ); // if there are (s on the stack, ()s were unbalanced

View File

@ -145,5 +145,4 @@ class WC_Payment_Token_CC extends WC_Payment_Token {
public function set_last4( $last4 ) {
$this->add_meta_data( 'last4', $last4, true );
}
}

View File

@ -65,5 +65,4 @@ class WC_Payment_Token_eCheck extends WC_Payment_Token {
public function set_last4( $last4 ) {
$this->add_meta_data( 'last4', $last4, true );
}
}

View File

@ -122,11 +122,9 @@ class WC_Shortcode_Checkout {
} else {
wc_add_notice( sprintf( __( 'This order&rsquo;s status is &ldquo;%s&rdquo;&mdash;it cannot be paid for. Please contact us if you need assistance.', 'woocommerce' ), wc_get_order_status_name( $order->get_status() ) ), 'error' );
}
} else {
wc_add_notice( __( 'Sorry, this order is invalid and cannot be paid for.', 'woocommerce' ), 'error' );
}
} elseif ( $order_id ) {
// Pay for order after checkout step
@ -169,11 +167,9 @@ class WC_Shortcode_Checkout {
} else {
wc_add_notice( sprintf( __( 'This order&rsquo;s status is &ldquo;%s&rdquo;&mdash;it cannot be paid for. Please contact us if you need assistance.', 'woocommerce' ), wc_get_order_status_name( $order->get_status() ) ), 'error' );
}
} else {
wc_add_notice( __( 'Sorry, this order is invalid and cannot be paid for.', 'woocommerce' ), 'error' );
}
} else {
wc_add_notice( __( 'Invalid order.', 'woocommerce' ), 'error' );
}

View File

@ -391,7 +391,5 @@ class WC_Shortcode_My_Account {
do_action( 'after_woocommerce_add_payment_method' );
}
}
}

View File

@ -64,15 +64,12 @@ class WC_Shortcode_Order_Tracking {
return;
}
} else {
echo '<p class="woocommerce-error">' . sprintf( __( 'Sorry, we could not find that order ID in our database.', 'woocommerce' ), get_permalink($post->ID ) ) . '</p>';
}
}
}
wc_get_template( 'order/form-tracking.php' );

View File

@ -485,5 +485,4 @@ abstract class WP_REST_Controller {
return $endpoint_args;
}
}

View File

@ -271,5 +271,4 @@ if ( ! function_exists( 'rest_sanitize_request_arg' ) ) {
return $value;
}
}

View File

@ -40,7 +40,6 @@ function wc_notice_count( $notice_type = '' ) {
foreach ( $all_notices as $notices ) {
$notice_count += absint( sizeof( $all_notices ) );
}
}
return $notice_count;

View File

@ -165,7 +165,6 @@ function wc_products_rss_feed() {
$feed = add_query_arg( 'product_cat', $term->slug, get_post_type_archive_feed_link( 'product' ) );
echo '<link rel="alternate" type="application/rss+xml" title="' . esc_attr( sprintf( __( 'New products added to %s', 'woocommerce' ), $term->name ) ) . '" href="' . esc_url( $feed ) . '" />';
}
} elseif ( is_tax( 'product_tag' ) ) {
$term = get_term_by('slug', esc_attr( get_query_var('product_tag') ), 'product_tag');

View File

@ -127,7 +127,6 @@ class WC_Widget_Product_Categories extends WC_Widget {
$this->current_cat = end( $product_category );
$this->cat_ancestors = get_ancestors( $this->current_cat->term_id, 'product_cat' );
}
}
// Show Siblings and Children Only
@ -184,7 +183,6 @@ class WC_Widget_Product_Categories extends WC_Widget {
if ( empty( $include ) ) {
return;
}
} elseif ( $show_children_only ) {
$dropdown_args['depth'] = 1;
$dropdown_args['child_of'] = 0;

View File

@ -40,7 +40,6 @@ if ( ! empty( $breadcrumb ) ) {
if ( sizeof( $breadcrumb ) !== $key + 1 ) {
echo $delimiter;
}
}
echo $wrap_after;

View File

@ -130,7 +130,6 @@ class WC_Unit_Tests_Bootstrap {
return self::$instance;
}
}
WC_Unit_Tests_Bootstrap::instance();

View File

@ -75,5 +75,4 @@ class WC_API_Unit_Test_Case extends WC_Unit_Test_Case {
$user->get_role_caps();
$user->update_user_level_from_caps();
}
}

View File

@ -192,5 +192,4 @@ class WC_Mock_WC_Data extends WC_Data {
}
$this->save_meta_data();
}
}

View File

@ -26,5 +26,4 @@ class WC_Payment_Token_Stub extends WC_Payment_Token {
public function set_extra( $extra ) {
$this->add_meta_data( 'extra', $extra, true );
}
}

View File

@ -29,5 +29,4 @@
global $wp_rest_server;
$wp_rest_server = null;
}
}

View File

@ -100,5 +100,4 @@ class WC_Unit_Test_Case extends WP_UnitTestCase {
parent::assertNotFalse( $condition, $message );
}
}
}

View File

@ -24,5 +24,4 @@ class WC_Unit_Test_Factory extends WP_UnitTest_Factory {
$this->webhook = new WC_Unit_Test_Factory_For_Webhook( $this );
$this->webhook_delivery = new WC_Unit_Test_Factory_For_Webhook_Delivery( $this );
}
}

View File

@ -58,5 +58,4 @@ class WC_Unit_Test_Factory_For_Webhook_Delivery extends WP_UnitTest_Factory_For_
return $id;
}
}

View File

@ -67,5 +67,4 @@ class WC_Unit_Test_Factory_For_Webhook extends WP_UnitTest_Factory_For_Post {
return new WC_Webhook( $id );
}
}

View File

@ -54,5 +54,4 @@ class WC_Helper_Coupon {
wp_delete_post( $coupon_id, true );
return true;
}
}

View File

@ -54,5 +54,4 @@ class WC_Helper_Payment_Token {
$token->save();
return $token;
}
}

View File

@ -261,5 +261,4 @@ class WC_Helper_Product {
return wp_insert_comment( $data );
}
}

View File

@ -77,5 +77,4 @@ class WC_Helper_Settings {
);
return $settings;
}
}

View File

@ -428,5 +428,4 @@ class WC_Tests_API_Coupons extends WC_REST_Unit_Test_Case {
$this->assertArrayHasKey( 'email_restrictions', $properties );
$this->assertArrayHasKey( 'used_by', $properties );
}
}

View File

@ -521,5 +521,4 @@ class Customers extends WC_REST_Unit_Test_Case {
$this->assertArrayHasKey( 'postcode', $properties['shipping']['properties'] );
$this->assertArrayHasKey( 'country', $properties['shipping']['properties'] );
}
}

Some files were not shown because too many files have changed in this diff Show More