From 454b97080aa8bde8956f0250baff07df17e87b7c Mon Sep 17 00:00:00 2001 From: splashingpixels Date: Wed, 22 Jan 2014 20:36:24 -0800 Subject: [PATCH] coding standards fixes --- templates/cart/cart-shipping.php | 2 +- templates/checkout/form-billing.php | 2 +- templates/checkout/form-pay.php | 2 +- templates/checkout/form-shipping.php | 2 +- templates/checkout/review-order.php | 4 ++-- templates/emails/admin-new-order.php | 2 +- .../emails/plain/customer-new-account.php | 4 ++-- .../emails/plain/customer-reset-password.php | 2 +- templates/global/breadcrumb.php | 2 +- templates/loop/orderby.php | 2 +- templates/loop/rating.php | 2 +- templates/loop/sale-flash.php | 2 +- .../myaccount/form-add-payment-method.php | 2 +- templates/myaccount/my-address.php | 2 +- templates/single-product-reviews.php | 20 +++++++++---------- templates/single-product/rating.php | 2 +- templates/single-product/related.php | 4 ++-- templates/single-product/review.php | 2 +- templates/single-product/tabs/description.php | 2 +- uninstall.php | 16 +++++++-------- woocommerce.php | 8 ++++---- 21 files changed, 43 insertions(+), 43 deletions(-) diff --git a/templates/cart/cart-shipping.php b/templates/cart/cart-shipping.php index eca245b7477..93ed90abaeb 100644 --- a/templates/cart/cart-shipping.php +++ b/templates/cart/cart-shipping.php @@ -27,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly echo wp_kses_post( wc_cart_totals_shipping_method_label( $method ) ); ?> - + get_value('createaccount') || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true) ?> type="checkbox" name="createaccount" value="1" /> + get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true) ?> type="checkbox" name="createaccount" value="1" />

diff --git a/templates/checkout/form-pay.php b/templates/checkout/form-pay.php index 8c37e3c2e00..9e66ae13c82 100644 --- a/templates/checkout/form-pay.php +++ b/templates/checkout/form-pay.php @@ -62,7 +62,7 @@ global $woocommerce; foreach ( $available_gateways as $gateway ) { ?>
  • - chosen) echo 'checked="checked"'; ?> /> + chosen ) echo 'checked="checked"'; ?> /> has_fields() || $gateway->get_description() ) { diff --git a/templates/checkout/form-shipping.php b/templates/checkout/form-shipping.php index b94c3a268ed..760daf4de97 100644 --- a/templates/checkout/form-shipping.php +++ b/templates/checkout/form-shipping.php @@ -50,7 +50,7 @@ global $woocommerce; - + cart->needs_shipping() || WC()->cart->ship_to_billing_address_only() ) : ?> diff --git a/templates/checkout/review-order.php b/templates/checkout/review-order.php index ceffe47729b..0727a681876 100644 --- a/templates/checkout/review-order.php +++ b/templates/checkout/review-order.php @@ -50,8 +50,8 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly - cart->tax_display_cart == 'excl' ) : ?> - + cart->tax_display_cart === 'excl' ) : ?> + cart->get_tax_totals() as $code => $tax ) : ?> label ); ?> diff --git a/templates/emails/admin-new-order.php b/templates/emails/admin-new-order.php index 117e5def982..3e6c875aea6 100644 --- a/templates/emails/admin-new-order.php +++ b/templates/emails/admin-new-order.php @@ -43,7 +43,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?> - + diff --git a/templates/emails/plain/customer-new-account.php b/templates/emails/plain/customer-new-account.php index fa8845dc0b9..cffe4386f67 100644 --- a/templates/emails/plain/customer-new-account.php +++ b/templates/emails/plain/customer-new-account.php @@ -12,10 +12,10 @@ echo $email_heading . "\n\n"; echo sprintf( __( "Thanks for creating an account on %s. Your username is %s.", 'woocommerce' ), $blogname, $user_login ) . "\n\n"; -if ( get_option( 'woocommerce_registration_generate_password' ) == 'yes' && $password_generated ) +if ( get_option( 'woocommerce_registration_generate_password' ) === 'yes' && $password_generated ) echo sprintf( __( "Your password is %s.", 'woocommerce' ), $user_pass ) . "\n\n"; -echo sprintf(__( 'You can access your account area to view your orders and change your password here: %s.', 'woocommerce' ), get_permalink( wc_get_page_id( 'myaccount' ) ) ) . "\n\n"; +echo sprintf( __( 'You can access your account area to view your orders and change your password here: %s.', 'woocommerce' ), get_permalink( wc_get_page_id( 'myaccount' ) ) ) . "\n\n"; echo "\n****************************************************\n\n"; diff --git a/templates/emails/plain/customer-reset-password.php b/templates/emails/plain/customer-reset-password.php index cf66926aee8..4b315e57ee6 100644 --- a/templates/emails/plain/customer-reset-password.php +++ b/templates/emails/plain/customer-reset-password.php @@ -12,7 +12,7 @@ echo $email_heading . "\n\n"; echo __( 'Someone requested that the password be reset for the following account:', 'woocommerce' ) . "\r\n\r\n"; echo network_home_url( '/' ) . "\r\n\r\n"; -echo sprintf(__( 'Username: %s', 'woocommerce' ), $user_login) . "\r\n\r\n"; +echo sprintf( __( 'Username: %s', 'woocommerce' ), $user_login ) . "\r\n\r\n"; echo __( 'If this was a mistake, just ignore this email and nothing will happen.', 'woocommerce' ) . "\r\n\r\n"; echo __( 'To reset your password, visit the following address:', 'woocommerce' ) . "\r\n\r\n"; diff --git a/templates/global/breadcrumb.php b/templates/global/breadcrumb.php index 9cbfd8ac32c..941200abe84 100644 --- a/templates/global/breadcrumb.php +++ b/templates/global/breadcrumb.php @@ -41,7 +41,7 @@ if ( ( ! is_home() && ! is_front_page() && ! ( is_post_type_archive() && get_opt echo $before . single_cat_title( '', false ) . $after; - } elseif ( is_tax('product_cat') ) { + } elseif ( is_tax( 'product_cat' ) ) { echo $prepend; diff --git a/templates/loop/orderby.php b/templates/loop/orderby.php index 1ab8a45570c..c8fb3a94bfa 100644 --- a/templates/loop/orderby.php +++ b/templates/loop/orderby.php @@ -26,7 +26,7 @@ if ( 1 == $wp_query->found_posts || ! woocommerce_products_will_display() ) 'price-desc' => __( 'Sort by price: high to low', 'woocommerce' ) ) ); - if ( get_option( 'woocommerce_enable_review_rating' ) == 'no' ) + if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' ) unset( $catalog_orderby['rating'] ); foreach ( $catalog_orderby as $id => $name ) diff --git a/templates/loop/rating.php b/templates/loop/rating.php index f0f8a20c4f6..6a7b682b93c 100644 --- a/templates/loop/rating.php +++ b/templates/loop/rating.php @@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly global $product; -if ( get_option( 'woocommerce_enable_review_rating' ) == 'no' ) +if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' ) return; ?> diff --git a/templates/loop/sale-flash.php b/templates/loop/sale-flash.php index c49eb878534..f197f2b9588 100644 --- a/templates/loop/sale-flash.php +++ b/templates/loop/sale-flash.php @@ -13,6 +13,6 @@ global $post, $product; ?> is_on_sale() ) : ?> - ' . __( 'Sale!', 'woocommerce' ).'', $post, $product ); ?> + ' . __( 'Sale!', 'woocommerce' ) . '', $post, $product ); ?> \ No newline at end of file diff --git a/templates/myaccount/form-add-payment-method.php b/templates/myaccount/form-add-payment-method.php index 61394f0a156..1b83297bf2c 100644 --- a/templates/myaccount/form-add-payment-method.php +++ b/templates/myaccount/form-add-payment-method.php @@ -37,7 +37,7 @@ global $woocommerce; } } else { - echo '

    '.__( 'Sorry, it seems that there are no payment methods which support adding a new payment method. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ).'

    '; + echo '

    ' . __( 'Sorry, it seems that there are no payment methods which support adding a new payment method. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ) . '

    '; } ?> diff --git a/templates/myaccount/my-address.php b/templates/myaccount/my-address.php index 8897043e211..46f2a7a865a 100644 --- a/templates/myaccount/my-address.php +++ b/templates/myaccount/my-address.php @@ -13,7 +13,7 @@ global $woocommerce; $customer_id = get_current_user_id(); -if ( get_option('woocommerce_ship_to_billing_address_only') == 'no' && get_option('woocommerce_calc_shipping') !== 'no' ) { +if ( get_option( 'woocommerce_ship_to_billing_address_only' ) === 'no' && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) { $page_title = apply_filters( 'woocommerce_my_account_my_address_title', __( 'My Addresses', 'woocommerce' ) ); $get_addresses = apply_filters( 'woocommerce_my_account_get_addresses', array( 'billing' => __( 'Billing Address', 'woocommerce' ), diff --git a/templates/single-product-reviews.php b/templates/single-product-reviews.php index 5ea0857b8d7..849999c97a5 100644 --- a/templates/single-product-reviews.php +++ b/templates/single-product-reviews.php @@ -17,7 +17,7 @@ if ( ! comments_open() )

    get_rating_count() ) ) + if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' && ( $count = $product->get_rating_count() ) ) printf( _n('%s review for %s', '%s reviews for %s', $count, 'woocommerce'), $count, get_the_title() ); else _e( 'Reviews', 'woocommerce' ); @@ -43,7 +43,7 @@ if ( ! comments_open() )

    - id ) ) : ?> + id ) ) : ?>
    @@ -51,7 +51,7 @@ if ( ! comments_open() ) $commenter = wp_get_current_commenter(); $comment_form = array( - 'title_reply' => have_comments() ? __( 'Add a review', 'woocommerce' ) : __( 'Be the first to review', 'woocommerce' ).' “' . get_the_title() . '”', + 'title_reply' => have_comments() ? __( 'Add a review', 'woocommerce' ) : __( 'Be the first to review', 'woocommerce' ) . ' “' . get_the_title() . '”', 'title_reply_to' => __( 'Leave a Reply to %s', 'woocommerce' ), 'comment_notes_before' => '', 'comment_notes_after' => '', @@ -66,14 +66,14 @@ if ( ! comments_open() ) 'comment_field' => '' ); - if ( get_option('woocommerce_enable_review_rating') == 'yes' ) { + if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) { $comment_form['comment_field'] = '

    '; } diff --git a/templates/single-product/rating.php b/templates/single-product/rating.php index 3a08b216908..85fb73a0e47 100644 --- a/templates/single-product/rating.php +++ b/templates/single-product/rating.php @@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly global $product; -if ( get_option( 'woocommerce_enable_review_rating' ) == 'no' ) +if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' ) return; $count = $product->get_rating_count(); diff --git a/templates/single-product/related.php b/templates/single-product/related.php index 2170cb076ba..b0a3199af46 100644 --- a/templates/single-product/related.php +++ b/templates/single-product/related.php @@ -15,7 +15,7 @@ $related = $product->get_related( $posts_per_page ); if ( sizeof( $related ) == 0 ) return; -$args = apply_filters('woocommerce_related_products_args', array( +$args = apply_filters( 'woocommerce_related_products_args', array( 'post_type' => 'product', 'ignore_sticky_posts' => 1, 'no_found_rows' => 1, @@ -27,7 +27,7 @@ $args = apply_filters('woocommerce_related_products_args', array( $products = new WP_Query( $args ); -$woocommerce_loop['columns'] = $columns; +$woocommerce_loop['columns'] = $columns; if ( $products->have_posts() ) : ?> diff --git a/templates/single-product/review.php b/templates/single-product/review.php index 7d97f150681..510d8011c61 100644 --- a/templates/single-product/review.php +++ b/templates/single-product/review.php @@ -38,7 +38,7 @@ $rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) );

    comment_author_email, $comment->user_id, $comment->comment_post_ID ) ) echo '(' . __( 'verified owner', 'woocommerce' ) . ') '; diff --git a/templates/single-product/tabs/description.php b/templates/single-product/tabs/description.php index e94cd9c2f76..26e7a129cb2 100644 --- a/templates/single-product/tabs/description.php +++ b/templates/single-product/tabs/description.php @@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly global $woocommerce, $post; -$heading = esc_html( apply_filters('woocommerce_product_description_heading', __( 'Product Description', 'woocommerce' ) ) ); +$heading = esc_html( apply_filters( 'woocommerce_product_description_heading', __( 'Product Description', 'woocommerce' ) ) ); ?>

    diff --git a/uninstall.php b/uninstall.php index 4c42dfba2b8..8f6f2c00f2d 100644 --- a/uninstall.php +++ b/uninstall.php @@ -21,14 +21,14 @@ $installer = include( 'includes/class-wc-install.php' ); $installer->remove_roles(); // Pages -wp_delete_post( get_option('woocommerce_shop_page_id'), true ); -wp_delete_post( get_option('woocommerce_cart_page_id'), true ); -wp_delete_post( get_option('woocommerce_checkout_page_id'), true ); -wp_delete_post( get_option('woocommerce_myaccount_page_id'), true ); -wp_delete_post( get_option('woocommerce_edit_address_page_id'), true ); -wp_delete_post( get_option('woocommerce_view_order_page_id'), true ); -wp_delete_post( get_option('woocommerce_change_password_page_id'), true ); -wp_delete_post( get_option('woocommerce_logout_page_id'), true ); +wp_delete_post( get_option( 'woocommerce_shop_page_id' ), true ); +wp_delete_post( get_option( 'woocommerce_cart_page_id' ), true ); +wp_delete_post( get_option( 'woocommerce_checkout_page_id' ), true ); +wp_delete_post( get_option( 'woocommerce_myaccount_page_id' ), true ); +wp_delete_post( get_option( 'woocommerce_edit_address_page_id' ), true ); +wp_delete_post( get_option( 'woocommerce_view_order_page_id' ), true ); +wp_delete_post( get_option( 'woocommerce_change_password_page_id' ), true ); +wp_delete_post( get_option( 'woocommerce_logout_page_id' ), true ); // mijireh checkout page if ( $mijireh_page = get_page_by_path( 'mijireh-secure-checkout' ) ) diff --git a/woocommerce.php b/woocommerce.php index 8a99132d510..d96c5501c56 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -265,7 +265,7 @@ final class WooCommerce { // 1 = PHP_ROUND_HALF_UP, 2 = PHP_ROUND_HALF_DOWN if ( ! defined( 'WC_TAX_ROUNDING_MODE' ) ) { - define( 'WC_TAX_ROUNDING_MODE', get_option( 'woocommerce_prices_include_tax' ) == 'yes' ? 2 : 1 ); + define( 'WC_TAX_ROUNDING_MODE', get_option( 'woocommerce_prices_include_tax' ) === 'yes' ? 2 : 1 ); } if ( ! defined( 'WC_DELIMITER' ) ) { @@ -287,11 +287,11 @@ final class WooCommerce { include_once( 'includes/admin/class-wc-admin.php' ); } - if ( defined('DOING_AJAX') ) { + if ( defined( 'DOING_AJAX' ) ) { $this->ajax_includes(); } - if ( ! is_admin() || defined('DOING_AJAX') ) { + if ( ! is_admin() || defined( 'DOING_AJAX' ) ) { $this->frontend_includes(); } @@ -385,7 +385,7 @@ final class WooCommerce { $this->integrations = new WC_Integrations(); // Integrations class // Classes/actions loaded for the frontend and for ajax requests - if ( ! is_admin() || defined('DOING_AJAX') ) { + if ( ! is_admin() || defined( 'DOING_AJAX' ) ) { // Session class, handles session data for customers - can be overwritten if custom handler is needed $session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );