src/utils/RedirectCheckout.php
The function VindiRedirectToMyAccount() contains an exit expression. Open
Open
exit;
- Read upRead up
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
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
Open
<?php
- Exclude checks
Inline control structures are not allowed Open
Open
if(is_user_logged_in() || get_option('woocommerce_enable_guest_checkout') == "yes") return;
- Exclude checks
Whitespace found at end of line Open
Open
(! is_user_logged_in() && get_option('woocommerce_enable_guest_checkout') == "no")
- Exclude checks
Whitespace found at end of line Open
Open
&& (is_checkout())
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
Open
exit;
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
Open
wp_redirect(get_permalink( wc_get_page_id( 'myaccount' ) ));
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
}
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
<a href="<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>">
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
if(is_user_logged_in() || get_option('woocommerce_enable_guest_checkout') == "yes") return;
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
if (
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
wp_redirect(get_permalink( wc_get_page_id( 'myaccount' ) ));
- Exclude checks
Opening brace should be on a new line Open
Open
function VindiRedirectToMyAccount() {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
wp_redirect(get_permalink( wc_get_page_id( 'myaccount' ) ));
- Exclude checks
Opening brace should be on a new line Open
Open
function VindiRedirectInfo() {
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if(is_user_logged_in() || get_option('woocommerce_enable_guest_checkout') == "yes") return;
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
<?php _e('Clique aqui para acessar uma conta existente ou criá-la.', VINDI ); ?>
- Exclude checks
Line indented incorrectly; expected at least 4 spaces, found 2 Open
Open
) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
Open
<?php _e('Para finalizar sua compra, é necessário estar logado', VINDI); ?>
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 6 Open
Open
<?php _e('Clique aqui para acessar uma conta existente ou criá-la.', VINDI ); ?>
- Exclude checks
Expected 0 spaces after opening bracket; newline found Open
Open
if (
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 2 Open
Open
?>
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
wp_redirect(get_permalink( wc_get_page_id( 'myaccount' ) ));
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
<a href="<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>">
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
wp_redirect(get_permalink( wc_get_page_id( 'myaccount' ) ));
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
<a href="<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>">
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
<a href="<?php echo get_permalink( wc_get_page_id( 'myaccount' ) ); ?>">
- Exclude checks