Issues (4138)

templates/archive-exercise.php (10 issues)

1
<?php
2
/**
3
 * The template for displaying Exercises Archive.
4
 *
5
 * @package lsx-health-plan
6
 */
7
8
get_header(); ?>
9
10
<?php lsx_content_wrap_before(); ?>
11
12
<?php
13
	$page_id  = get_the_ID();
14
	$redirect = '/content-restricted/?r=' . $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
0 ignored issues
show
Are you sure $page_id of type false|integer can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

14
	$redirect = '/content-restricted/?r=' . /** @scrutinizer ignore-type */ $page_id . '&wcm_redirect_to=archive&wcm_redirect_id=' . $page_id;
Loading history...
15
?>
16
17
	<div id="primary" class="content-area <?php echo esc_attr( lsx_main_class() ); ?>">
18
19
		<?php lsx_content_before(); ?>
20
21
		<!-- Begining restricted content -->
22
		<?php
23
		if ( ! function_exists( 'wc_memberships_view_restricted_post_content' ) || current_user_can( 'wc_memberships_view_restricted_post_content', $page_id ) ) {
24
			?>
25
			<main id="main" role="main">
26
27
				<?php lsx_content_top(); ?>
28
29
				<div class="post-wrapper exercise-archive-plan archive-plan">
30
					<div class="row">
31
						<?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...
32
							<?php
33
							while ( 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...
34
								the_post();
35
								?>
36
37
								<?php include LSX_HEALTH_PLAN_PATH . '/templates/content-archive-exercise.php'; ?>
38
39
							<?php endwhile; ?>
40
41
						<?php else : ?>
0 ignored issues
show
Blank line found at start of control structure
Loading history...
42
43
							<?php get_template_part( 'partials/content', 'none' ); ?>
44
45
						<?php endif; ?>
46
					</div>
47
					<?php lsx_paging_nav(); ?>
48
				</div>
49
				<?php lsx_content_bottom(); ?>
50
51
			</main><!-- #main -->
52
53
			<?php
54
		} else {
55
			wp_redirect( $redirect );
0 ignored issues
show
wp_redirect() found. Using wp_safe_redirect(), along with the allowed_redirect_hosts filter if needed, can help avoid any chances of malicious redirects within code. It is also important to remember to call exit() after a redirect so that no other unwanted code is executed.
Loading history...
56
			exit;
57
		}
58
		?>
59
60
<?php lsx_content_after(); ?>
61
62
</div><!-- #primary -->
63
64
<?php lsx_content_wrap_after(); ?>
65
66
<?php //get_sidebar(); ?>
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% 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 "// get_sidebar();" but found "//get_sidebar();"
Loading history...
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
67
68
<?php
69
get_footer();
70