Skip to content

Commit

Permalink
coding standards fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
splashingpixels committed Jan 23, 2014
1 parent 1a41687 commit 454b970
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion templates/cart/cart-shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
echo wp_kses_post( wc_cart_totals_shipping_method_label( $method ) ); ?>
<input type="hidden" name="shipping_method[<?php echo $index; ?>]" data-index="<?php echo $index; ?>" id="shipping_method_<?php echo $index; ?>" value="<?php echo esc_attr( $method->id ); ?>" class="shipping_method" />

<?php elseif ( get_option('woocommerce_shipping_method_format') == 'select' ) : ?>
<?php elseif ( get_option( 'woocommerce_shipping_method_format' ) === 'select' ) : ?>

<select name="shipping_method[<?php echo $index; ?>]" data-index="<?php echo $index; ?>" id="shipping_method_<?php echo $index; ?>" class="shipping_method">
<?php foreach ( $available_methods as $method ) : ?>
Expand Down
2 changes: 1 addition & 1 deletion templates/checkout/form-billing.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<?php if ( $checkout->enable_guest_checkout ) : ?>

<p class="form-row form-row-wide create-account">
<input class="input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value('createaccount') || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true) ?> type="checkbox" name="createaccount" value="1" /> <label for="createaccount" class="checkbox"><?php _e( 'Create an account?', 'woocommerce' ); ?></label>
<input class="input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true) ?> type="checkbox" name="createaccount" value="1" /> <label for="createaccount" class="checkbox"><?php _e( 'Create an account?', 'woocommerce' ); ?></label>
</p>

<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion templates/checkout/form-pay.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
foreach ( $available_gateways as $gateway ) {
?>
<li class="payment_method_<?php echo $gateway->id; ?>">
<input id="payment_method_<?php echo $gateway->id; ?>" type="radio" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php if ($gateway->chosen) echo 'checked="checked"'; ?> />
<input id="payment_method_<?php echo $gateway->id; ?>" type="radio" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php if ( $gateway->chosen ) echo 'checked="checked"'; ?> />
<label for="payment_method_<?php echo $gateway->id; ?>"><?php echo $gateway->get_title(); ?> <?php echo $gateway->get_icon(); ?></label>
<?php
if ( $gateway->has_fields() || $gateway->get_description() ) {
Expand Down
2 changes: 1 addition & 1 deletion templates/checkout/form-shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<?php do_action( 'woocommerce_before_order_notes', $checkout ); ?>

<?php if ( apply_filters( 'woocommerce_enable_order_notes_field', get_option( 'woocommerce_enable_order_comments', 'yes' ) == 'yes' ) ) : ?>
<?php if ( apply_filters( 'woocommerce_enable_order_notes_field', get_option( 'woocommerce_enable_order_comments', 'yes' ) === 'yes' ) ) : ?>

<?php if ( ! WC()->cart->needs_shipping() || WC()->cart->ship_to_billing_address_only() ) : ?>

Expand Down
4 changes: 2 additions & 2 deletions templates/checkout/review-order.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
</tr>
<?php endforeach; ?>

<?php if ( WC()->cart->tax_display_cart == 'excl' ) : ?>
<?php if ( get_option( 'woocommerce_tax_total_display' ) == 'itemized' ) : ?>
<?php if ( WC()->cart->tax_display_cart === 'excl' ) : ?>
<?php if ( get_option( 'woocommerce_tax_total_display' ) === 'itemized' ) : ?>
<?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?>
<tr class="tax-rate tax-rate-<?php echo sanitize_title( $code ); ?>">
<th><?php echo esc_html( $tax->label ); ?></th>
Expand Down
2 changes: 1 addition & 1 deletion templates/emails/admin-new-order.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</tfoot>
</table>

<?php do_action('woocommerce_email_after_order_table', $order, true, false ); ?>
<?php do_action( 'woocommerce_email_after_order_table', $order, true, false ); ?>

<?php do_action( 'woocommerce_email_order_meta', $order, true, false ); ?>

Expand Down
4 changes: 2 additions & 2 deletions templates/emails/plain/customer-new-account.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

echo sprintf( __( "Thanks for creating an account on %s. Your username is <strong>%s</strong>.", '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 <strong>%s</strong>.", '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";

Expand Down
2 changes: 1 addition & 1 deletion templates/emails/plain/customer-reset-password.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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";

Expand Down
2 changes: 1 addition & 1 deletion templates/global/breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

echo $before . single_cat_title( '', false ) . $after;

} elseif ( is_tax('product_cat') ) {
} elseif ( is_tax( 'product_cat' ) ) {

echo $prepend;

Expand Down
2 changes: 1 addition & 1 deletion templates/loop/orderby.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'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 )
Expand Down
2 changes: 1 addition & 1 deletion templates/loop/rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

global $product;

if ( get_option( 'woocommerce_enable_review_rating' ) == 'no' )
if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' )
return;
?>

Expand Down
2 changes: 1 addition & 1 deletion templates/loop/sale-flash.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
?>
<?php if ( $product->is_on_sale() ) : ?>

<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'woocommerce' ).'</span>', $post, $product ); ?>
<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?>

<?php endif; ?>
2 changes: 1 addition & 1 deletion templates/myaccount/form-add-payment-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
} else {

echo '<p>'.__( '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' ).'</p>';
echo '<p>' . __( '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' ) . '</p>';

}
?>
Expand Down
2 changes: 1 addition & 1 deletion templates/myaccount/my-address.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

$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' ),
Expand Down
20 changes: 10 additions & 10 deletions templates/single-product-reviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div id="reviews">
<div id="comments">
<h2><?php
if ( get_option( 'woocommerce_enable_review_rating' ) == 'yes' && ( $count = $product->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' );
Expand All @@ -43,15 +43,15 @@
<?php endif; ?>
</div>

<?php if ( get_option( 'woocommerce_review_rating_verification_required' ) == 'no' || wc_customer_bought_product( '', get_current_user_id(), $product->id ) ) : ?>
<?php if ( get_option( 'woocommerce_review_rating_verification_required' ) === 'no' || wc_customer_bought_product( '', get_current_user_id(), $product->id ) ) : ?>

<div id="review_form_wrapper">
<div id="review_form">
<?php
$commenter = wp_get_current_commenter();

$comment_form = array(
'title_reply' => have_comments() ? __( 'Add a review', 'woocommerce' ) : __( 'Be the first to review', 'woocommerce' ).' &ldquo;' . get_the_title() . '&rdquo;',
'title_reply' => have_comments() ? __( 'Add a review', 'woocommerce' ) : __( 'Be the first to review', 'woocommerce' ) . ' &ldquo;' . get_the_title() . '&rdquo;',
'title_reply_to' => __( 'Leave a Reply to %s', 'woocommerce' ),
'comment_notes_before' => '',
'comment_notes_after' => '',
Expand All @@ -66,14 +66,14 @@
'comment_field' => ''
);

if ( get_option('woocommerce_enable_review_rating') == 'yes' ) {
if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) {
$comment_form['comment_field'] = '<p class="comment-form-rating"><label for="rating">' . __( 'Your Rating', 'woocommerce' ) .'</label><select name="rating" id="rating">
<option value="">'.__( 'Rate&hellip;', 'woocommerce' ).'</option>
<option value="5">'.__( 'Perfect', 'woocommerce' ).'</option>
<option value="4">'.__( 'Good', 'woocommerce' ).'</option>
<option value="3">'.__( 'Average', 'woocommerce' ).'</option>
<option value="2">'.__( 'Not that bad', 'woocommerce' ).'</option>
<option value="1">'.__( 'Very Poor', 'woocommerce' ).'</option>
<option value="">' . __( 'Rate&hellip;', 'woocommerce' ) . '</option>
<option value="5">' . __( 'Perfect', 'woocommerce' ) . '</option>
<option value="4">' . __( 'Good', 'woocommerce' ) . '</option>
<option value="3">' . __( 'Average', 'woocommerce' ) . '</option>
<option value="2">' . __( 'Not that bad', 'woocommerce' ) . '</option>
<option value="1">' . __( 'Very Poor', 'woocommerce' ) . '</option>
</select></p>';
}

Expand Down
2 changes: 1 addition & 1 deletion templates/single-product/rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

global $product;

if ( get_option( 'woocommerce_enable_review_rating' ) == 'no' )
if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' )
return;

$count = $product->get_rating_count();
Expand Down
4 changes: 2 additions & 2 deletions templates/single-product/related.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

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,
Expand All @@ -27,7 +27,7 @@

$products = new WP_Query( $args );

$woocommerce_loop['columns'] = $columns;
$woocommerce_loop['columns'] = $columns;

if ( $products->have_posts() ) : ?>

Expand Down
2 changes: 1 addition & 1 deletion templates/single-product/review.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<p class="meta">
<strong itemprop="author"><?php comment_author(); ?></strong> <?php

if ( get_option('woocommerce_review_rating_verification_label') == 'yes' )
if ( get_option( 'woocommerce_review_rating_verification_label' ) === 'yes' )
if ( wc_customer_bought_product( $comment->comment_author_email, $comment->user_id, $comment->comment_post_ID ) )
echo '<em class="verified">(' . __( 'verified owner', 'woocommerce' ) . ')</em> ';

Expand Down
2 changes: 1 addition & 1 deletion templates/single-product/tabs/description.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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' ) ) );
?>

<h2><?php echo $heading; ?></h2>
Expand Down
16 changes: 8 additions & 8 deletions uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
$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' ) )
Expand Down
8 changes: 4 additions & 4 deletions woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private function define_constants() {

// 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' ) ) {
Expand All @@ -287,11 +287,11 @@ private function includes() {
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();
}

Expand Down Expand Up @@ -385,7 +385,7 @@ public function init() {
$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' );
Expand Down

0 comments on commit 454b970

Please sign in to comment.