From e336886afa8b58f07f22c28d4fc7adf60fde07dc Mon Sep 17 00:00:00 2001 From: sumnermic Date: Fri, 12 Aug 2016 13:58:54 +0100 Subject: [PATCH 1/9] Add anchor attribute target "_blank" Add anchor attribute target "_blank" to Regenerate Thumbnails link. It's pretty annoying for it to not open in a new window/tab. --- includes/admin/settings/class-wc-settings-products.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' ), From e99798f16e9bcb94c27eb14c7359fcf5ca741a50 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 16 Aug 2016 11:57:25 +0100 Subject: [PATCH 2/9] Date modified is read only and set by WP after update --- includes/class-wc-customer.php | 5 ++--- tests/unit-tests/customer/crud.php | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) 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/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() ); } From 5a0f0cf5b4dfe8f4d6e608c122d79c843eea76b1 Mon Sep 17 00:00:00 2001 From: JLuis Freitas Date: Tue, 16 Aug 2016 17:10:09 +0100 Subject: [PATCH 3/9] add PT (Portugal) address format add $postcode_before_city format to portuguese addresses --- includes/class-wc-countries.php | 1 + 1 file changed, 1 insertion(+) 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}", From 8bd29fa06e8908b0129a9632b8b02a415f6c1623 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Tue, 16 Aug 2016 16:06:14 -0300 Subject: [PATCH 4/9] Include REST API classes in apigen cc @mikejolley --- apigen.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/ From 3cf8058f9b50d6b56a9d6a2b78af552e4dd4cbe5 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Tue, 16 Aug 2016 16:55:26 -0300 Subject: [PATCH 5/9] DRY #11614 --- includes/wc-formatting-functions.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; From 7b44b8954e74709c81e277f5c310f1419e35cce6 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Tue, 16 Aug 2016 17:56:26 -0300 Subject: [PATCH 6/9] Removed confuse min WP requirement --- readme.txt | 1 - 1 file changed, 1 deletion(-) 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) From b6cc54f3a1ebbb3934f0b9c66ab776d1ddea4d95 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Tue, 16 Aug 2016 18:26:42 -0300 Subject: [PATCH 7/9] Always apply stylelint #11658 --- Gruntfile.js | 1 + 1 file changed, 1 insertion(+) 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' ]); From 74484c70093bb59f71dbc13c3247080341f5ec32 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Thu, 18 Aug 2016 00:41:46 -0300 Subject: [PATCH 8/9] [2.6] [REST API] Fixed undefined order ID, closes #11707 --- includes/api/class-wc-rest-order-refunds-controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From 838f3737ea4c3ea1b17fee05e3734dee495227c4 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Thu, 18 Aug 2016 00:53:27 -0300 Subject: [PATCH 9/9] [2.6] Fixed downloadable variable product URL, closes #11699 --- includes/wc-user-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(),