Issues (631)

comments.php (19 issues)

Labels
Severity
1
<?php
2
/**
3
 * The template for displaying comments
4
 *
5
 * This is the template that displays the area of the page that contains both the current comments
6
 * and the comment form.
7
 *
8
 * @link https://codex.wordpress.org/Template_Hierarchy
9
 *
10
 * @package WordPress
11
 * @subpackage Strip
12
 * @since 1.2.2
13
 * @version 1.0
14
 */
15
/*
16
 * If the current post is protected by a password and
17
 * the visitor has not yet entered the password we will
18
 * return early without loading the comments.
19
 */
20
if ( post_password_required() ) {
0 ignored issues
show
The function post_password_required was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

20
if ( /** @scrutinizer ignore-call */ post_password_required() ) {
Loading history...
21
	return;
22
}
23
?>
24
25
<div id="comments" class="comments-area">
26
27
	<?php
28
	// You can start editing here -- including this comment!
29
	if ( have_comments() ) : ?>
0 ignored issues
show
The function have_comments was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

29
	if ( /** @scrutinizer ignore-call */ have_comments() ) : ?>
Loading history...
30
		<h2 class="comments-title">
31
			<?php
32
				$comments_number = get_comments_number();
0 ignored issues
show
The function get_comments_number was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

32
				$comments_number = /** @scrutinizer ignore-call */ get_comments_number();
Loading history...
33
			if ( '1' === $comments_number ) {
34
				/* translators: %s: post title */
35
				printf( esc_html_x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'strip' ), get_the_title() );
0 ignored issues
show
The function esc_html_x was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

35
				printf( /** @scrutinizer ignore-call */ esc_html_x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'strip' ), get_the_title() );
Loading history...
The function get_the_title was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

35
				printf( esc_html_x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'strip' ), /** @scrutinizer ignore-call */ get_the_title() );
Loading history...
36
			} else {
37
				printf(
38
					esc_attr(
0 ignored issues
show
The function esc_attr was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

38
					/** @scrutinizer ignore-call */ 
39
     esc_attr(
Loading history...
39
						/* translators: 1: number of comments, 2: post title */
40
						_nx(
0 ignored issues
show
The function _nx was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

40
						/** @scrutinizer ignore-call */ 
41
      _nx(
Loading history...
41
							'%1$s Reply to &ldquo;%2$s&rdquo;',
42
							'%1$s Replies to &ldquo;%2$s&rdquo;',
43
							$comments_number,
44
							'comments title',
45
							'strip'
46
						)
47
					),
48
					esc_html( number_format_i18n( $comments_number ) ),
0 ignored issues
show
The function esc_html was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

48
					/** @scrutinizer ignore-call */ 
49
     esc_html( number_format_i18n( $comments_number ) ),
Loading history...
The function number_format_i18n was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

48
					esc_html( /** @scrutinizer ignore-call */ number_format_i18n( $comments_number ) ),
Loading history...
49
					get_the_title()
50
				);
51
			}
52
			?>
53
		</h2>
54
55
		<ol class="comment-list">
56
			<?php
57
				wp_list_comments( array(
0 ignored issues
show
The function wp_list_comments was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

57
				/** @scrutinizer ignore-call */ 
58
    wp_list_comments( array(
Loading history...
58
					'avatar_size' => 96,
59
					'style'       => 'ol',
60
					'short_ping'  => true,
61
					'reply_text'  => __( 'Reply', 'strip' ),
0 ignored issues
show
The function __ was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

61
					'reply_text'  => /** @scrutinizer ignore-call */ __( 'Reply', 'strip' ),
Loading history...
62
				) );
63
			?>
64
		</ol>
65
66
		<?php $comment_pagination = paginate_comments_links(
0 ignored issues
show
The function paginate_comments_links was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

66
		<?php $comment_pagination = /** @scrutinizer ignore-call */ paginate_comments_links(
Loading history...
67
 				array(
68
 					'echo'      => false,
69
 					'end_size'  => 0,
70
 					'mid_size'  => 0,
71
 					'next_text' => __( 'Newer Comments', 'Strip' ) . ' &rarr;',
72
 					'prev_text' => '&larr; ' . __( 'Older Comments', 'Strip' ),
73
 				)
74
 			);
75
 			if ( $comment_pagination ) {
76
 				$pagination_classes = '';
77
 				// If we're only showing the "Next" link, add a class indicating so.
78
 				if ( false === strpos( $comment_pagination, 'prev page-numbers' ) ) {
79
 					$pagination_classes = ' only-next';
80
 				}
81
 				?>
82
83
 				<nav class="comments-pagination pagination<?php echo $pagination_classes; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>" aria-label="<?php esc_attr_e( 'Comments', 'Strip' ); ?>">
0 ignored issues
show
The function esc_attr_e was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

83
 				<nav class="comments-pagination pagination<?php echo $pagination_classes; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>" aria-label="<?php /** @scrutinizer ignore-call */ esc_attr_e( 'Comments', 'Strip' ); ?>">
Loading history...
84
 					<?php echo wp_kses_post( $comment_pagination ); ?>
0 ignored issues
show
The function wp_kses_post was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

84
 					<?php echo /** @scrutinizer ignore-call */ wp_kses_post( $comment_pagination ); ?>
Loading history...
85
 				</nav>
86
87
 				<?php
88
 			}
89
90
	endif; // Check for have_comments().
91
92
	// If comments are closed and there are comments, let's leave a little note, shall we?
93
	if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
0 ignored issues
show
The function post_type_supports was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

93
	if ( ! comments_open() && get_comments_number() && /** @scrutinizer ignore-call */ post_type_supports( get_post_type(), 'comments' ) ) : ?>
Loading history...
The function comments_open was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

93
	if ( ! /** @scrutinizer ignore-call */ comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
Loading history...
The function get_post_type was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

93
	if ( ! comments_open() && get_comments_number() && post_type_supports( /** @scrutinizer ignore-call */ get_post_type(), 'comments' ) ) : ?>
Loading history...
94
95
		<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'strip' ); ?></p>
0 ignored issues
show
The function esc_html_e was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

95
		<p class="no-comments"><?php /** @scrutinizer ignore-call */ esc_html_e( 'Comments are closed.', 'strip' ); ?></p>
Loading history...
96
	<?php
97
	endif;
98
99
	comment_form();
0 ignored issues
show
The function comment_form was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

99
	/** @scrutinizer ignore-call */ 
100
 comment_form();
Loading history...
100
	?>
101
102
</div><!-- #comments -->
103