Issues (4138)

templates/page-template-my-plan.php (30 issues)

1
<?php
2
/**
3
 * WooCommerce My Account / My Plan Page
4
 *
5
 * Template Name: My Plan
6
 *
7
 * @package    lsx-health-plan
8
 * @subpackage template
9
 */
10
11
get_header(); ?>
12
13
<?php lsx_content_wrap_before(); ?>
14
15
<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
16
17
	<?php lsx_content_before(); ?>
18
19
	<main id="main" class="site-main" role="main">
20
21
		<?php lsx_content_top(); ?>
22
23
		<?php if ( have_posts() ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
Blank line found at start of control structure
Loading history...
24
25
			<?php while ( have_posts() ) : the_post(); ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
26
27
				<?php lsx_entry_before(); ?>
28
29
				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
30
31
					<?php lsx_entry_top(); ?>
32
33
					<div class="entry-content">
34
						<?php
35
						if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'edit-account' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
36
							$classes = get_body_class();
37
							if ( in_array( 'has-block-banner', $classes ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Not using strict comparison for in_array; supply true for third argument.
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
38
								$blocks = parse_blocks( get_the_content() );
39
								foreach ( $blocks as $block ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
40
									if ( 'lsx-blocks/lsx-banner-box' === $block['blockName'] ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
41
										echo wp_kses_post( $block['innerHTML'] );
42
									}
43
								}
44
							} elseif ( in_array( 'has-block-cover', $classes ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Not using strict comparison for in_array; supply true for third argument.
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
45
								$blocks = parse_blocks( get_the_content() );
46
								foreach ( $blocks as $block ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
47
									//print( '<pre>' . print_r( $block, true ) . '</pre>' );
0 ignored issues
show
Unused Code Comprehensibility introduced by
48% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
No space found before comment text; expected "// print( '<pre>' . print_r( $block, true ) . '</pre>' );" but found "//print( '<pre>' . print_r( $block, true ) . '</pre>' );"
Loading history...
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
48
									if ( 'core/cover' === $block['blockName'] ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
49
										echo wp_kses_post( render_block( $block ) );
50
									}
51
								}
52
							} else {
53
								$my_plan_string = esc_html__( 'My Dashboard', 'lsx-health-plan' );
54
								echo wp_kses_post( '<div class="lsx-health-plan my-profile-block wp-block-cover alignfull"><div class="wp-block-cover__inner-container"><h2>' . $my_plan_string . '</h2></div></div>' );
55
							}
56
57
							if ( is_user_logged_in() ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
58
								$my_profile_string  = esc_html__( 'My Profile', 'lsx-health-plan' );
59
								$my_profile_tagline = esc_html__( 'Update your details below', 'lsx-health-plan' );
60
							}
0 ignored issues
show
No blank line found after control structure
Loading history...
61
							echo do_shortcode( '<div id="edit-account-tab">[lsx_health_plan_my_profile_tabs]<div class="edit-account-section"><h2 class="title-lined">' . $my_profile_string . '</h2><p>' . $my_profile_tagline . '</p>[woocommerce_my_account]</div></div>' );
62
						} else if ( function_exists( 'is_wc_endpoint_url' ) && is_wc_endpoint_url( 'lost-password' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
63
							echo do_shortcode( '[woocommerce_my_account]' );
64
						} else {
65
							the_content();
66
						}
67
						?>
68
					</div><!-- .entry-content -->
69
70
					<?php lsx_entry_bottom(); ?>
71
72
				</article><!-- #post-## -->
73
74
				<?php lsx_entry_after(); ?>
75
76
			<?php endwhile; ?>
77
78
		<?php endif; ?>
79
80
		<?php lsx_content_bottom(); ?>
81
82
	</main><!-- #main -->
83
84
	<?php lsx_content_after(); ?>
85
86
</div><!-- #primary -->
87
88
<?php lsx_content_wrap_after(); ?>
89
90
<?php get_footer();
0 ignored issues
show
Opening PHP tag must be on a line by itself
Loading history...
91