vindi/vindi-woocommerce

View on GitHub
src/utils/RedirectCheckout.php

Summary

Maintainability
A
0 mins
Test Coverage

Showing 27 of 27 total issues

The function VindiRedirectToMyAccount() contains an exit expression.
Open

exit;
Severity: Minor
Found in src/utils/RedirectCheckout.php by phpmd

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 10 and the first side effect is on line 19.
Open

<?php

Inline control structures are not allowed
Open

if(is_user_logged_in() || get_option('woocommerce_enable_guest_checkout') == "yes") return;

Whitespace found at end of line
Open

(! is_user_logged_in() && get_option('woocommerce_enable_guest_checkout') == "no")

Expected 0 spaces after opening bracket; newline found
Open

if (

Expected 0 spaces before closing bracket; 1 found
Open

wp_redirect(get_permalink( wc_get_page_id( 'myaccount' ) ));

Whitespace found at end of line
Open

&& (is_checkout())

Line indented incorrectly; expected at least 8 spaces, found 6
Open

wp_redirect(get_permalink( wc_get_page_id( 'myaccount' ) ));

Space after opening parenthesis of function call prohibited
Open

wp_redirect(get_permalink( wc_get_page_id( 'myaccount' ) ));

Expected 0 spaces before closing bracket; 1 found
Open

wp_redirect(get_permalink( wc_get_page_id( 'myaccount' ) ));

Expected 0 spaces before closing bracket; 1 found
Open

<?php _e('Clique aqui para acessar uma conta existente ou criá-la.', VINDI ); ?>

Space after opening parenthesis of function call prohibited
Open

<a href="<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>">

Opening brace should be on a new line
Open

function VindiRedirectInfo() {

Line indented incorrectly; expected 4 spaces, found 2
Open

if (

Line indented incorrectly; expected 4 spaces, found 2
Open

}

Line indented incorrectly; expected at least 4 spaces, found 2
Open

) {

Line indented incorrectly; expected 4 spaces, found 2
Open

?>

Line indented incorrectly; expected 8 spaces, found 6
Open

<?php _e('Clique aqui para acessar uma conta existente ou criá-la.', VINDI ); ?>

Space after opening parenthesis of function call prohibited
Open

wp_redirect(get_permalink( wc_get_page_id( 'myaccount' ) ));

Expected 0 spaces before closing bracket; 1 found
Open

<a href="<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>">

Expected 1 space after IF keyword; 0 found
Open

if(is_user_logged_in() || get_option('woocommerce_enable_guest_checkout') == "yes") return;

Line indented incorrectly; expected 8 spaces, found 6
Open

<?php _e('Para finalizar sua compra, é necessário estar logado', VINDI); ?>

Opening brace should be on a new line
Open

function VindiRedirectToMyAccount() {

Line indented incorrectly; expected at least 4 spaces, found 2
Open

if(is_user_logged_in() || get_option('woocommerce_enable_guest_checkout') == "yes") return;

Line indented incorrectly; expected at least 8 spaces, found 6
Open

exit;

Space after opening parenthesis of function call prohibited
Open

<a href="<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>">

Expected 0 spaces before closing bracket; 1 found
Open

<a href="<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>">

There are no issues that match your filters.

Category
Status