From 0b416439c89311475d51ec76f932972b3b464afc Mon Sep 17 00:00:00 2001 From: Akeda Bagus Date: Wed, 29 Mar 2017 00:58:51 +0700 Subject: [PATCH 1/2] Fixed all typos of all files in includes/ directory. Scanning and fixing were done automatically by codespell, https://github.com/lucasdemarchi/codespell. --- includes/abstracts/abstract-wc-data.php | 4 ++-- includes/abstracts/abstract-wc-rest-controller.php | 2 +- includes/abstracts/abstract-wc-rest-crud-controller.php | 2 +- includes/abstracts/abstract-wc-rest-posts-controller.php | 2 +- includes/abstracts/abstract-wc-rest-terms-controller.php | 2 +- includes/admin/class-wc-admin-settings.php | 2 +- includes/admin/reports/class-wc-report-coupon-usage.php | 4 ++-- includes/admin/reports/class-wc-report-customers.php | 2 +- includes/class-wc-order.php | 2 +- includes/class-wc-tracker.php | 6 +++--- includes/data-stores/class-wc-product-data-store-cpt.php | 2 +- .../paypal/includes/class-wc-gateway-paypal-ipn-handler.php | 4 ++-- .../class-wc-gateway-simplify-commerce.php | 2 +- includes/libraries/class-wc-eval-math.php | 2 +- includes/log-handlers/class-wc-log-handler-file.php | 2 +- .../legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php | 2 +- includes/wc-coupon-functions.php | 2 +- includes/wc-order-functions.php | 2 +- includes/widgets/class-wc-widget-product-tag-cloud.php | 2 +- includes/widgets/class-wc-widget-rating-filter.php | 2 +- 20 files changed, 25 insertions(+), 25 deletions(-) diff --git a/includes/abstracts/abstract-wc-data.php b/includes/abstracts/abstract-wc-data.php index ec60bfbddc1..da57cf3a265 100644 --- a/includes/abstracts/abstract-wc-data.php +++ b/includes/abstracts/abstract-wc-data.php @@ -91,7 +91,7 @@ abstract class WC_Data { protected $cache_group = ''; /** - * Stores additonal meta data. + * Stores additional meta data. * * @since 3.0.0 * @var array @@ -168,7 +168,7 @@ abstract class WC_Data { } /** - * Save should create or update based on object existance. + * Save should create or update based on object existence. * * @since 2.6.0 * @return int diff --git a/includes/abstracts/abstract-wc-rest-controller.php b/includes/abstracts/abstract-wc-rest-controller.php index 41f33696c77..c2c39555635 100644 --- a/includes/abstracts/abstract-wc-rest-controller.php +++ b/includes/abstracts/abstract-wc-rest-controller.php @@ -5,7 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) { } /** - * Abstract Rest Controler Class + * Abstract Rest Controller Class * * @author WooThemes * @category API diff --git a/includes/abstracts/abstract-wc-rest-crud-controller.php b/includes/abstracts/abstract-wc-rest-crud-controller.php index eaf90c74423..d81dbdece0b 100644 --- a/includes/abstracts/abstract-wc-rest-crud-controller.php +++ b/includes/abstracts/abstract-wc-rest-crud-controller.php @@ -1,6 +1,6 @@ get_order_report_data( $total_coupons_query ) ); $legend[] = array( - /* translators: %s: discount ammount */ + /* translators: %s: discount amount */ 'title' => sprintf( __( '%s discounts in total', 'woocommerce' ), '' . wc_price( $total_discount ) . '' ), 'color' => $this->chart_colours['discount_amount'], 'highlight_series' => 1, ); $legend[] = array( - /* translators: %s: coupons ammount */ + /* translators: %s: coupons amount */ 'title' => sprintf( __( '%s coupons used in total', 'woocommerce' ), '' . $total_coupons . '' ), 'color' => $this->chart_colours['coupon_count'], 'highlight_series' => 0, diff --git a/includes/admin/reports/class-wc-report-customers.php b/includes/admin/reports/class-wc-report-customers.php index dd0827e80eb..ceb64b0d20d 100644 --- a/includes/admin/reports/class-wc-report-customers.php +++ b/includes/admin/reports/class-wc-report-customers.php @@ -37,7 +37,7 @@ class WC_Report_Customers extends WC_Admin_Report { $legend = array(); $legend[] = array( - /* translators: %s: signups ammount */ + /* translators: %s: signups amount */ 'title' => sprintf( __( '%s signups in this period', 'woocommerce' ), '' . sizeof( $this->customers ) . '' ), 'color' => $this->chart_colours['signups'], 'highlight_series' => 2, diff --git a/includes/class-wc-order.php b/includes/class-wc-order.php index 2b684170987..ad58ee0b2c4 100644 --- a/includes/class-wc-order.php +++ b/includes/class-wc-order.php @@ -309,7 +309,7 @@ class WC_Order extends WC_Abstract_Order { $transition_note = sprintf( __( 'Order status set to %s.', 'woocommerce' ), wc_get_order_status_name( $this->status_transition['to'] ) ); } - // Note the transition occured + // Note the transition occurred $this->add_order_note( trim( $this->status_transition['note'] . ' ' . $transition_note ), 0, $this->status_transition['manual'] ); // This has ran, so reset status transition variable diff --git a/includes/class-wc-tracker.php b/includes/class-wc-tracker.php index d5d6aa3e82c..9c784c42fa3 100644 --- a/includes/class-wc-tracker.php +++ b/includes/class-wc-tracker.php @@ -3,7 +3,7 @@ * WooCommerce Tracker * * The WooCommerce tracker class adds functionality to track WooCommerce usage based on if the customer opted in. - * No personal infomation is tracked, only general WooCommerce settings, general product, order and user counts and admin email for discount code. + * No personal information is tracked, only general WooCommerce settings, general product, order and user counts and admin email for discount code. * * @class WC_Tracker * @version 2.3.0 @@ -37,7 +37,7 @@ class WC_Tracker { * @param boolean $override */ public static function send_tracking_data( $override = false ) { - // Dont trigger this on AJAX Requests + // Don't trigger this on AJAX Requests if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { return; } @@ -49,7 +49,7 @@ class WC_Tracker { return; } } else { - // Make sure there is at least a 1 hour delay between override sends, we dont want duplicate calls due to double clicking links. + // Make sure there is at least a 1 hour delay between override sends, we don't want duplicate calls due to double clicking links. $last_send = self::get_last_send_time(); if ( $last_send && $last_send > strtotime( '-1 hours' ) ) { return; diff --git a/includes/data-stores/class-wc-product-data-store-cpt.php b/includes/data-stores/class-wc-product-data-store-cpt.php index 23e1165bc36..8d02961f52c 100644 --- a/includes/data-stores/class-wc-product-data-store-cpt.php +++ b/includes/data-stores/class-wc-product-data-store-cpt.php @@ -1128,7 +1128,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da 'order' => $args['order'], 'tax_query' => array(), ); - // Do not load unneccessary post data if the user only wants IDs. + // Do not load unnecessary post data if the user only wants IDs. if ( 'ids' === $args['return'] ) { $wp_query_args['fields'] = 'ids'; } diff --git a/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php b/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php index af15b6c55bb..da4435f2c23 100644 --- a/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php +++ b/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php @@ -283,7 +283,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response { } /** - * Handle a reveral. + * Handle a reversal. * @param WC_Order $order * @param array $posted */ @@ -297,7 +297,7 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response { } /** - * Handle a cancelled reveral. + * Handle a cancelled reversal. * @param WC_Order $order * @param array $posted */ diff --git a/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php b/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php index b6b55baf88d..c419391a860 100644 --- a/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php +++ b/includes/gateways/simplify-commerce/class-wc-gateway-simplify-commerce.php @@ -339,7 +339,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway_CC { } /** - * Actualy saves a customer token to the database. + * Actually saves a customer token to the database. * * @param WC_Payment_Token $customer_token Payment Token * @param string $cart_token CC Token diff --git a/includes/libraries/class-wc-eval-math.php b/includes/libraries/class-wc-eval-math.php index 3278a994386..d8936c1af1c 100644 --- a/includes/libraries/class-wc-eval-math.php +++ b/includes/libraries/class-wc-eval-math.php @@ -208,7 +208,7 @@ if ( ! class_exists( 'WC_Eval_Math', false ) ) { } elseif ( in_array( $op, $ops ) and ! $expecting_op ) { return self::trigger( "unexpected operator '$op'" ); } else { // I don't even want to know what you did to get here - return self::trigger( "an unexpected error occured" ); + return self::trigger( "an unexpected error occurred" ); } if ( strlen( $expr ) == $index ) { if ( in_array( $op, $ops ) ) { // did we end with an operator? bad. diff --git a/includes/log-handlers/class-wc-log-handler-file.php b/includes/log-handlers/class-wc-log-handler-file.php index 6a8ae2139bf..cc66305a647 100644 --- a/includes/log-handlers/class-wc-log-handler-file.php +++ b/includes/log-handlers/class-wc-log-handler-file.php @@ -78,7 +78,7 @@ class WC_Log_Handler_File extends WC_Log_Handler { * * @type string $source Optional. Determines log file to write to. Default 'log'. * @type bool $_legacy Optional. Default false. True to use outdated log format - * orignally used in deprecated WC_Logger::add calls. + * originally used in deprecated WC_Logger::add calls. * } * * @return bool False if value was not handled and true if value was handled. diff --git a/includes/shipping/legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php b/includes/shipping/legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php index 854258e9019..18838c25358 100644 --- a/includes/shipping/legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php +++ b/includes/shipping/legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php @@ -273,7 +273,7 @@ class WC_Shipping_Legacy_Flat_Rate extends WC_Shipping_Method { * * @deprecated 2.4.0 * - * Additonal rates defined like this: + * Additional rates defined like this: * Option Name | Additional Cost [+- Percents%] | Per Cost Type (order, class, or item). */ public function calculate_extra_shipping( $method, $rate ) { diff --git a/includes/wc-coupon-functions.php b/includes/wc-coupon-functions.php index da59b6a0819..bc07372ea13 100644 --- a/includes/wc-coupon-functions.php +++ b/includes/wc-coupon-functions.php @@ -87,7 +87,7 @@ function wc_get_coupon_code_by_id( $id ) { * * @since 3.0.0 * @param string $code - * @param int $exclude Used to exclude an ID from the check if you're checking existance. + * @param int $exclude Used to exclude an ID from the check if you're checking existence. * @return int */ function wc_get_coupon_id_by_code( $code, $exclude = 0 ) { diff --git a/includes/wc-order-functions.php b/includes/wc-order-functions.php index 9f248f8091a..3e32160f875 100644 --- a/includes/wc-order-functions.php +++ b/includes/wc-order-functions.php @@ -166,7 +166,7 @@ function wc_get_order_id_by_order_key( $order_key ) { /** * Get all registered order types. * - * $for optionally define what you are getting order types for so only relevent types are returned. + * $for optionally define what you are getting order types for so only relevant types are returned. * * e.g. for 'order-meta-boxes', 'order-count' * diff --git a/includes/widgets/class-wc-widget-product-tag-cloud.php b/includes/widgets/class-wc-widget-product-tag-cloud.php index 549811f3efc..a680aec2d72 100644 --- a/includes/widgets/class-wc-widget-product-tag-cloud.php +++ b/includes/widgets/class-wc-widget-product-tag-cloud.php @@ -75,7 +75,7 @@ class WC_Widget_Product_Tag_Cloud extends WC_Widget { } /** - * Retuns topic count text. + * Returns topic count text. * * @since 2.6.0 * @param int $count diff --git a/includes/widgets/class-wc-widget-rating-filter.php b/includes/widgets/class-wc-widget-rating-filter.php index e282093fb47..79f86b2f166 100644 --- a/includes/widgets/class-wc-widget-rating-filter.php +++ b/includes/widgets/class-wc-widget-rating-filter.php @@ -91,7 +91,7 @@ class WC_Widget_Rating_Filter extends WC_Widget { } /** - * Count products after other filters have occured by adjusting the main query. + * Count products after other filters have occurred by adjusting the main query. * @param int $rating * @return int */ From 757b5ae2c4bdab4e15139097a97459cb3bb9a1b3 Mon Sep 17 00:00:00 2001 From: Akeda Bagus Date: Wed, 29 Mar 2017 01:02:31 +0700 Subject: [PATCH 2/2] Fixed all typo in tests/ directory. --- tests/unit-tests/api/payment-gateways.php | 2 +- tests/unit-tests/api/products.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit-tests/api/payment-gateways.php b/tests/unit-tests/api/payment-gateways.php index c0700a13491..f79091ceed6 100644 --- a/tests/unit-tests/api/payment-gateways.php +++ b/tests/unit-tests/api/payment-gateways.php @@ -264,7 +264,7 @@ class Payment_Gateways extends WC_REST_Unit_Test_Case { } /** - * Loads a particualr gateway's settings so we can correctly test API output. + * Loads a particular gateway's settings so we can correctly test API output. * * @since 3.0.0 * @param string $gateway_class Name of WC_Payment_Gateway class. diff --git a/tests/unit-tests/api/products.php b/tests/unit-tests/api/products.php index 94e95fc59dc..8c55e333db0 100644 --- a/tests/unit-tests/api/products.php +++ b/tests/unit-tests/api/products.php @@ -180,7 +180,7 @@ class Products_API extends WC_REST_Unit_Test_Case { $this->assertContains( 'Dr1Bczxq4q', $data['images'][0]['src'] ); $this->assertContains( 'test upload image', $data['images'][0]['alt'] ); - // test variable product (varations are tested in product-variations.php) + // test variable product (variations are tested in product-variations.php) $product = WC_Helper_Product::create_variation_product(); $response = $this->server->dispatch( new WP_REST_Request( 'GET', '/wc/v2/products/' . $product->get_id() ) ); $data = $response->get_data();