diff --git a/Gruntfile.js b/Gruntfile.js index 467a7fcbbf1..4ed8cf0f34d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -255,6 +255,7 @@ module.exports = function( grunt ) { ]); grunt.registerTask( 'css', [ + 'stylelint', 'sass', 'cssmin' ]); diff --git a/apigen.neon b/apigen.neon index 40c74fe34cb..98dc528246e 100644 --- a/apigen.neon +++ b/apigen.neon @@ -10,7 +10,7 @@ extensions: [php] # directories and files matching this file mask will not be parsed exclude: - includes/libraries/ - - includes/api/ + - includes/api/legacy/ - i18n/ - node_modules/ - wc-apidocs/ diff --git a/includes/admin/settings/class-wc-settings-products.php b/includes/admin/settings/class-wc-settings-products.php index 6dfdb8e16a4..88cf34f2f08 100644 --- a/includes/admin/settings/class-wc-settings-products.php +++ b/includes/admin/settings/class-wc-settings-products.php @@ -175,7 +175,7 @@ class WC_Settings_Products extends WC_Settings_Page { array( 'title' => __( 'Product Images', 'woocommerce' ), 'type' => 'title', - 'desc' => sprintf( __( 'These settings affect the display and dimensions of images in your catalog - the display on the front-end will still be affected by CSS styles. After changing these settings you may need to regenerate your thumbnails.', 'woocommerce' ), 'https://wordpress.org/extend/plugins/regenerate-thumbnails/' ), + 'desc' => sprintf( __( 'These settings affect the display and dimensions of images in your catalog - the display on the front-end will still be affected by CSS styles. After changing these settings you may need to regenerate your thumbnails.', 'woocommerce' ), 'https://wordpress.org/extend/plugins/regenerate-thumbnails/' ), 'id' => 'image_options' ), diff --git a/includes/api/class-wc-rest-order-refunds-controller.php b/includes/api/class-wc-rest-order-refunds-controller.php index 74716c1e730..42e76a7664b 100644 --- a/includes/api/class-wc-rest-order-refunds-controller.php +++ b/includes/api/class-wc-rest-order-refunds-controller.php @@ -300,7 +300,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Posts_Controller { $order = wc_get_order( $order_data ); if ( isset( $payment_gateways[ $order->get_payment_method() ] ) && $payment_gateways[ $order->get_payment_method() ]->supports( 'refunds' ) ) { - $result = $payment_gateways[ $order->get_payment_method() ]->process_refund( $order_id, $refund->get_refund_amount(), $refund->get_refund_reason() ); + $result = $payment_gateways[ $order->get_payment_method() ]->process_refund( $order->id, $refund->get_refund_amount(), $refund->get_refund_reason() ); if ( is_wp_error( $result ) ) { return $result; diff --git a/includes/class-wc-countries.php b/includes/class-wc-countries.php index f0798302b8a..5733e478539 100644 --- a/includes/class-wc-countries.php +++ b/includes/class-wc-countries.php @@ -434,6 +434,7 @@ class WC_Countries { 'NZ' => "{name}\n{company}\n{address_1}\n{address_2}\n{city} {postcode}\n{country}", 'NO' => $postcode_before_city, 'PL' => $postcode_before_city, + 'PT' => $postcode_before_city, 'SK' => $postcode_before_city, 'SI' => $postcode_before_city, 'ES' => "{name}\n{company}\n{address_1}\n{address_2}\n{postcode} {city}\n{state}\n{country}", diff --git a/includes/class-wc-customer.php b/includes/class-wc-customer.php index 62dc0de0b5d..11ac3d21544 100644 --- a/includes/class-wc-customer.php +++ b/includes/class-wc-customer.php @@ -991,10 +991,10 @@ class WC_Customer extends WC_Legacy_Customer { update_user_meta( $this->get_id(), 'last_update', $this->get_date_modified() ); update_user_meta( $this->get_id(), 'first_name', $this->get_first_name() ); update_user_meta( $this->get_id(), 'last_name', $this->get_last_name() ); - $this->set_date_modified( time() ); wp_update_user( array( 'ID' => $this->get_id(), 'role' => $this->get_role() ) ); $wp_user = new WP_User( $this->get_id() ); $this->set_date_created( strtotime( $wp_user->user_registered ) ); + $this->set_date_modified( get_user_meta( $this->get_id(), 'last_update', true ) ); $this->read_meta_data(); } } @@ -1074,11 +1074,10 @@ class WC_Customer extends WC_Legacy_Customer { update_user_meta( $this->get_id(), 'shipping_state', $this->get_shipping_state() ); update_user_meta( $this->get_id(), 'shipping_country', $this->get_shipping_country() ); update_user_meta( $this->get_id(), 'paying_customer', $this->get_is_paying_customer() ); - $this->set_date_modified( time() ); - update_user_meta( $this->get_id(), 'last_update', $this->get_date_modified() ); update_user_meta( $this->get_id(), 'first_name', $this->get_first_name() ); update_user_meta( $this->get_id(), 'last_name', $this->get_last_name() ); wp_update_user( array( 'ID' => $this->get_id(), 'role' => $this->get_role() ) ); + $this->set_date_modified( get_user_meta( $this->get_id(), 'last_update', true ) ); $this->save_meta_data(); } diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index d1f50f0dd3d..6ebcd912140 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -663,14 +663,12 @@ function wc_format_postcode( $postcode, $country ) { $postcode = trim( substr_replace( $postcode, ' ', -3, 0 ) ); break; case 'BR' : + case 'PL' : $postcode = trim( substr_replace( $postcode, '-', -3, 0 ) ); break; case 'JP' : $postcode = trim( substr_replace( $postcode, '-', 3, 0 ) ); break; - case 'PL' : - $postcode = trim( substr_replace( $postcode, '-', -3, 0 ) ); - break; case 'PT' : $postcode = trim( substr_replace( $postcode, '-', 4, 0 ) ); break; diff --git a/includes/wc-user-functions.php b/includes/wc-user-functions.php index 236c101c989..57f8d16e49a 100644 --- a/includes/wc-user-functions.php +++ b/includes/wc-user-functions.php @@ -453,7 +453,7 @@ function wc_get_customer_available_downloads( $customer_id ) { home_url( '/' ) ), 'download_id' => $result->download_id, - 'product_id' => $product_id, + 'product_id' => $_product->id, 'download_name' => $download_name, 'order_id' => $order->get_id(), 'order_key' => $order->get_order_key(), diff --git a/readme.txt b/readme.txt index 39c2d7b7263..bcc7f847ed1 100644 --- a/readme.txt +++ b/readme.txt @@ -88,7 +88,6 @@ And, finally, consider joining or spearheading a WooCommerce Meetup locally, mor = Minimum Requirements = -* WordPress 3.8 or greater * PHP version 5.2.4 or greater (PHP 5.6 or greater is recommended) * MySQL version 5.0 or greater (MySQL 5.6 or greater is recommended) * Some payment gateways require fsockopen support (for IPN access) diff --git a/tests/unit-tests/customer/crud.php b/tests/unit-tests/customer/crud.php index a27d4d93388..9dedb3bf0de 100644 --- a/tests/unit-tests/customer/crud.php +++ b/tests/unit-tests/customer/crud.php @@ -80,10 +80,6 @@ class WC_Tests_CustomerCRUD extends WC_Unit_Test_Case { $customer_id = $customer->get_id(); $this->assertNotEquals( 0, $customer->get_id() ); $customer->delete(); - - $user_object = get_user_by( 'id', $customer_id ); - $this->assertFalse( $user_object ); - $customer->read( $customer_id ); $this->assertEquals( 0, $customer->get_id() ); }