Issues (4138)

templates/featured-videos.php (14 issues)

1
<?php
2
/**
3
 * LSX Videos Shortcode.
4
 *
5
 * @package lsx-health-plan
6
 */
7
8
$args   = array(
9
	'orderby'        => 'date',
10
	'order'          => 'DESC',
11
	'post_type'      => 'video',
12
	'posts_per_page' => 3,
13
	'meta_key'       => 'video_featured_video',
0 ignored issues
show
Detected usage of meta_key, possible slow query.
Loading history...
14
	'meta_compare'   => 'EXISTS',
15
);
16
$videos = new WP_Query( $args );
17
?>
18
19
<div id="lsx-videos-shortcode" class="daily-plan-block">
20
	<h2 class="title-lined"><?php esc_html_e( 'Featured Workout', 'lsx-health-plan' ); ?></h2>
21
	<div class="lsx-videos-shortcode lsx-videos-slider slick-slider slick-dotted slick-has-arrows" data-slick="{'slidesToShow': 1, 'slidesToScroll': 1}" >
22
		<?php
23
		if ( $videos->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...
24
			while ( $videos->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...
25
				$videos->the_post();
26
27
				$featured = get_post_meta( get_the_ID(), 'video_featured_video', true );
0 ignored issues
show
It seems like get_the_ID() can also be of type false; however, parameter $post_id of get_post_meta() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

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

27
				$featured = get_post_meta( /** @scrutinizer ignore-type */ get_the_ID(), 'video_featured_video', true );
Loading history...
28
				$giphy    = get_post_meta( get_the_ID(), 'video_giphy_source', true );
29
				$youtube  = esc_url( get_post_meta( get_the_ID(), 'video_youtube_source', 1 ) );
30
				?>
31
				<div class="lsx-videos-slot">
32
					<div class="row">
33
						<div class="col-md-4">
34
							<h4 class="lsx-videos-title"><?php the_title(); ?></h4>
35
							<?php the_content(); ?>
36
						</div>
37
						<div class="col-md-8">
38
							<?php
39
							if ( ! empty( $giphy ) ) {
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
								echo $giphy; // WPCS: XSS OK.
0 ignored issues
show
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
41
							} elseif ( ! empty( $youtube ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
42
								echo wp_oembed_get( $youtube ); // WPCS: XSS OK.
0 ignored issues
show
Are you sure wp_oembed_get($youtube) of type false|string can be used in echo? ( Ignorable by Annotation )

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

42
								echo /** @scrutinizer ignore-type */ wp_oembed_get( $youtube ); // WPCS: XSS OK.
Loading history...
Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: XSS OK.
Loading history...
43
							}
44
							?>
45
						</div>
46
					</div>
47
				</div>
48
		<?php endwhile; ?>
0 ignored issues
show
Closing brace indented incorrectly; expected 12 spaces, found 8
Loading history...
49
		<?php endif; ?>
50
		<?php wp_reset_postdata(); ?>
51
	</div>
52
</div>
53