Issues (1223)

templates/content-single-team.php (83 issues)

1
<?php
2
/**
0 ignored issues
show
Missing short description in doc comment
Loading history...
3
 * @package lsx-team
4
 */
0 ignored issues
show
There must be exactly one blank line after the file comment
Loading history...
5
?>
6
7
<?php
8
	global $lsx_team;
9
10
	$thumbnail = $lsx_team->get_thumbnail( get_the_ID(), 'lsx-team-single' );
11
12
	$job_title = get_post_meta( get_the_ID(), 'lsx_job_title', 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

12
	$job_title = get_post_meta( /** @scrutinizer ignore-type */ get_the_ID(), 'lsx_job_title', true );
Loading history...
13
14
	$links = array(
15
		'facebook'  => get_post_meta( get_the_ID(), 'lsx_facebook', true ),
16
		'twitter'   => get_post_meta( get_the_ID(), 'lsx_twitter', true ),
17
		'linkedin'  => get_post_meta( get_the_ID(), 'lsx_linkedin', true ),
18
		'github'    => get_post_meta( get_the_ID(), 'lsx_github', true ),
19
		'wordpress' => get_post_meta( get_the_ID(), 'lsx_wordpress', true ),
20
	);
21
22
	foreach ( $links as $service => $link ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
23
		if ( empty( $link ) ) {
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
			unset( $links[ $service ] );
25
		}
26
	}
27
28
	$email = get_post_meta( get_the_ID(), 'lsx_email_contact', true );
29
	$phone = get_post_meta( get_the_ID(), 'lsx_tel', true );
30
	$skype = get_post_meta( get_the_ID(), 'lsx_skype', true );
31
32
	$phone_attr = $phone;
33
	$phone_attr = str_replace( ' ', '', $phone_attr );
34
	$phone_attr = str_replace( '+', '', $phone_attr );
35
	$phone_attr = str_replace( '(', '', $phone_attr );
36
	$phone_attr = str_replace( ')', '', $phone_attr );
37
	$phone_attr = str_replace( '.', '', $phone_attr );
38
39
	// Tabs
0 ignored issues
show
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
40
41
	$tabs = array();
42
43
	// Tab Posts
0 ignored issues
show
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
44
45
	$site_user = get_post_meta( get_the_ID(), 'lsx_site_user', true );
46
47
	if ( ! empty( $site_user ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
48
		if ( is_user_member_of_blog( $site_user ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
It seems like $site_user can also be of type string; however, parameter $user_id of is_user_member_of_blog() 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

48
		if ( is_user_member_of_blog( /** @scrutinizer ignore-type */ $site_user ) ) {
Loading history...
49
			$user_posts = count_user_posts( $site_user, 'post' );
0 ignored issues
show
It seems like $site_user can also be of type string; however, parameter $userid of count_user_posts() 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

49
			$user_posts = count_user_posts( /** @scrutinizer ignore-type */ $site_user, 'post' );
Loading history...
50
51
			if ( $user_posts > 0 ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
52
				$params = array(
53
					'post_type' => 'post',
0 ignored issues
show
Array double arrow not aligned correctly; expected 6 space(s) between "'post_type'" and double arrow, but found 1.
Loading history...
54
					'author' => $site_user,
0 ignored issues
show
Array double arrow not aligned correctly; expected 9 space(s) between "'author'" and double arrow, but found 1.
Loading history...
55
					'posts_per_page' => 9,
56
					'order' => 'DESC',
0 ignored issues
show
Array double arrow not aligned correctly; expected 10 space(s) between "'order'" and double arrow, but found 1.
Loading history...
57
					'orderby' => 'date',
0 ignored issues
show
Array double arrow not aligned correctly; expected 8 space(s) between "'orderby'" and double arrow, but found 1.
Loading history...
58
					'fields' => 'ids',
0 ignored issues
show
Array double arrow not aligned correctly; expected 9 space(s) between "'fields'" and double arrow, but found 1.
Loading history...
59
					'tax_query' => array(
0 ignored issues
show
Array double arrow not aligned correctly; expected 6 space(s) between "'tax_query'" and double arrow, but found 1.
Loading history...
Detected usage of tax_query, possible slow query.
Loading history...
60
						array(
61
							'taxonomy' => 'post_format',
62
							'field' => 'slug',
0 ignored issues
show
Array double arrow not aligned correctly; expected 4 space(s) between "'field'" and double arrow, but found 1.
Loading history...
63
							'terms' => array(
0 ignored issues
show
Array double arrow not aligned correctly; expected 4 space(s) between "'terms'" and double arrow, but found 1.
Loading history...
64
								'post-format-aside',
65
								'post-format-audio',
66
								'post-format-chat',
67
								'post-format-gallery',
68
								'post-format-image',
69
								'post-format-link',
70
								'post-format-quote',
71
								'post-format-status',
72
								'post-format-video',
73
							),
74
							'operator' => 'NOT IN',
75
						),
76
					),
77
				);
78
79
				$posts_query = new \WP_Query( $params );
80
81
				if ( $posts_query->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...
82
					$tab_post['post_type'] = 'post';
83
					$tab_post['title'] = esc_html__( 'Posts', 'lsx-team' );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
84
					$tab_post['posts'] = $posts_query->posts;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
85
86
					if ( ! empty( $tab_post['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...
87
						$post_ids = join( ',', $tab_post['posts'] );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 14 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
88
						$tab_post['shortcode'] = '[lsx_posts columns="3" limit="9" include="' . $post_ids . '"]';
89
						$tabs[] = $tab_post;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 16 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
90
					}
91
				}
92
			}
93
		}
94
	}
95
96
	// Tab Projects
0 ignored issues
show
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
97
98
	$tab_project['post_type'] = 'project';
99
	$tab_project['title'] = esc_html__( 'Projects', 'lsx-team' );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
100
	$tab_project['posts'] = get_post_meta( get_the_ID(), 'project_to_team', true );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
101
	if ( is_plugin_active( 'lsx-projects/lsx-projects.php' ) && ( ! empty( $tab_project['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...
102
		$post_ids = join( ',', $tab_project['posts'] );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 17 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
103
		$tab_project['shortcode'] = '[lsx_projects columns="3" include="' . $post_ids . '"]';
104
		$tabs[] = $tab_project;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 19 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
105
	}
106
107
	// Tab Services
0 ignored issues
show
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
108
109
	if ( is_plugin_active( 'lsx-services/lsx-services.php' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
110
		$tab_service['post_type'] = 'service';
111
		$tab_service['title'] = esc_html__( 'Services', 'lsx-team' );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
112
		$tab_service['posts'] = get_post_meta( get_the_ID(), 'service_to_team', true );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
113
114
		if ( ! empty( $tab_service['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...
115
			$post_ids = join( ',', $tab_service['posts'] );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 17 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
116
			$tab_service['shortcode'] = '[lsx_services columns="3" include="' . $post_ids . '"]';
117
			$tabs[] = $tab_service;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 19 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
118
		}
119
	}
120
121
	// Tab Testimonials
0 ignored issues
show
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
122
123
	$tab_testimonial['post_type'] = 'testimonial';
124
	$tab_testimonial['title'] = esc_html__( 'Testimonials', 'lsx-team' );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
125
	$tab_testimonial['posts'] = get_post_meta( get_the_ID(), 'testimonial_to_team', true );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
126
127
	if ( is_plugin_active( 'lsx-testimonials/lsx-testimonials.php' ) && ( ! empty( $tab_testimonial['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...
128
		if ( count( $tab_testimonial['posts'] ) <= 2 ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
129
			$columns = count( $tab_testimonial['posts'] );
130
		} else {
131
			$columns = 2;
132
		}
133
134
		$post_ids = join( ',', $tab_testimonial['posts'] );
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 21 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
135
		$tab_testimonial['shortcode'] = '[lsx_testimonials columns="' . $columns . '" include="' . $post_ids . '" orderby="date" order="DESC" display="excerpt"]';
136
		$tabs[] = $tab_testimonial;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 23 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
137
	}
138
?>
139
140
<?php lsx_entry_before(); ?>
141
142
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
143
144
	<?php lsx_entry_top(); ?>
145
146
	<div class="row">
147
		<div class="col-xs-12 col-sm-6 col-md-4">
148
			<figure class="lsx-team-avatar">
149
				<?php echo wp_kses_post( $thumbnail ); ?>
150
			</figure>
151
152
			<?php if ( count( $links ) > 0 ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
153
				<span class="lsx-team-socials-header"><?php echo esc_html__( 'Follow', 'lsx-team' ) . ':'; ?></span>
154
155
				<ul class="lsx-team-socials list-inline">
156
					<?php foreach ( $links as $service => $link ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
157
						<li><a href="<?php echo esc_html( $link ); ?>" target="_blank" rel="nofollow noreferrer noopener"><i class="fa fa-<?php echo esc_html( $service ); ?>" aria-hidden="true"></i></a></li>
0 ignored issues
show
It seems like $link can also be of type false; however, parameter $text of esc_html() does only seem to accept string, 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

157
						<li><a href="<?php echo esc_html( /** @scrutinizer ignore-type */ $link ); ?>" target="_blank" rel="nofollow noreferrer noopener"><i class="fa fa-<?php echo esc_html( $service ); ?>" aria-hidden="true"></i></a></li>
Loading history...
158
					<?php endforeach; ?>
159
				</ul>
160
			<?php endif; ?>
161
		</div>
162
163
		<div class="col-xs-12 col-sm-6 col-md-8">
164
			<h1 class="lsx-team-name"><?php the_title(); ?></h1>
165
			<h5 class="lsx-team-job-title"><?php echo esc_html( $job_title ); ?></h5>
166
			<div class="lsx-team-content"><?php the_content(); ?></div>
167
168
			<?php if ( ! empty( $email ) || ! empty( $phone ) || ! empty( $skype ) ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
169
				<ul class="lsx-team-contact list-inline">
170
					<?php if ( ! empty( $email ) ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
171
						<li><a href="mailto:<?php echo esc_attr( $email ); ?>"><i class="fa fa-envelope-o" aria-hidden="true"></i> <?php echo esc_attr( $email ); ?></a></li>
172
					<?php endif; ?>
173
174
					<?php if ( ! empty( $phone ) ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
175
						<li><a href="tel:<?php echo esc_attr( $phone_attr ); ?>"><i class="fa fa-phone" aria-hidden="true"></i> <?php echo esc_attr( $phone ); ?></a></li>
176
					<?php endif; ?>
177
178
					<?php if ( ! empty( $skype ) ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
179
						<li><i class="fa fa-skype" aria-hidden="true"></i> <?php echo esc_attr( $skype ); ?></li>
180
					<?php endif; ?>
181
				</ul>
182
			<?php endif; ?>
183
		</div>
184
	</div>
185
186
	<?php if ( count( $tabs ) > 0 ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
187
		<div class="entry-tabs">
188
			<ul class="nav nav-tabs">
189
				<?php foreach ( $tabs as $i => $tab ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
190
					<li<?php if ( 0 === $i ) echo ' class="active"'; ?>><a data-toggle="tab" href="#<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>"><?php echo esc_html( $tab['title'] ); ?></a></li>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
191
				<?php endforeach; ?>
192
			</ul>
193
194
			<div class="tab-content">
195
				<?php foreach ( $tabs as $i => $tab ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
196
					<div id="<?php echo esc_attr( sanitize_title( $tab['title'] ) ); ?>" class="tab-pane fade<?php if ( 0 === $i ) echo ' in active'; ?>">
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
197
						<?php echo do_shortcode( $tab['shortcode'] ); ?>
198
					</div>
199
				<?php endforeach; ?>
200
			</div>
201
		</div>
202
	<?php endif; ?>
203
204
	<?php lsx_entry_bottom(); ?>
205
206
</article><!-- #post-## -->
207
208
<?php lsx_entry_after();
0 ignored issues
show
Opening PHP tag must be on a line by itself
Loading history...
209