Test Failed
Push — master ( 3b4aec...d6370d )
by Paul
03:25
created
plugin/Handlers/EnqueueAdminAssets.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			glsr()->version,
45 45
 			true
46 46
 		);
47
-		if( !empty( $this->pointers )) {
47
+		if( !empty($this->pointers) ) {
48 48
 			wp_enqueue_style( 'wp-pointer' );
49 49
 			wp_enqueue_script( 'wp-pointer' );
50 50
 		}
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$dependencies = apply_filters( 'site-reviews/enqueue/admin/dependencies', [] );
85 85
 		$dependencies = array_merge( $dependencies, [
86 86
 			'jquery', 'jquery-ui-sortable', 'underscore', 'wp-util',
87
-		]);
87
+		] );
88 88
 		return $dependencies;
89 89
 	}
90 90
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		$generatedPointers = [];
115 115
 		foreach( $pointers as $pointer ) {
116 116
 			if( $pointer['screen'] != glsr_current_screen()->id )continue;
117
-			if( in_array( $pointer['id'], $dismissedPointers ))continue;
117
+			if( in_array( $pointer['id'], $dismissedPointers ) )continue;
118 118
 			$generatedPointers[] = $this->generatePointer( $pointer );
119 119
 		}
120 120
 		$this->pointers = $generatedPointers;
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	protected function isCurrentScreen()
127 127
 	{
128 128
 		$screen = glsr_current_screen();
129
-		return $screen && ( $screen->post_type == Application::POST_TYPE
129
+		return $screen && ($screen->post_type == Application::POST_TYPE
130 130
 			|| $screen->base == 'post'
131 131
 			|| $screen->id == 'dashboard'
132 132
 			|| $screen->id == 'widgets'
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	{
141 141
 		$variables = [];
142 142
 		foreach( glsr()->mceShortcodes as $tag => $args ) {
143
-			if( empty( $args['required'] ))continue;
143
+			if( empty($args['required']) )continue;
144 144
 			$variables[$tag] = $args['required'];
145 145
 		}
146 146
 		return $variables;
Please login to merge, or discard this patch.
autoload.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 defined( 'WPINC' ) || die;
4 4
 
5
-require_once( ABSPATH.WPINC.'/class-phpass.php' );
5
+require_once(ABSPATH.WPINC.'/class-phpass.php');
6 6
 
7 7
 spl_autoload_register( function( $className ) {
8 8
 	$namespaces = [
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 	foreach( $namespaces as $prefix => $baseDir ) {
17 17
 		$len = strlen( $prefix );
18 18
 		if( strncmp( $prefix, $className, $len ) !== 0 )continue;
19
-		$file = $baseDir.str_replace( '\\', '/', substr( $className, $len )).'.php';
20
-		if( !file_exists( $file ))continue;
19
+		$file = $baseDir.str_replace( '\\', '/', substr( $className, $len ) ).'.php';
20
+		if( !file_exists( $file ) )continue;
21 21
 		require $file;
22 22
 		break;
23 23
 	}
Please login to merge, or discard this patch.
plugin/Controllers/PublicController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 	public function routerSubmitReview( array $request )
51 51
 	{
52 52
 		$validated = glsr( ValidateReview::class )->validate( $request );
53
-		if( !empty( $validated->error ) || $validated->recaptchaIsUnset )return;
54
-		$this->execute( new CreateReview( $validated->request ));
53
+		if( !empty($validated->error) || $validated->recaptchaIsUnset )return;
54
+		$this->execute( new CreateReview( $validated->request ) );
55 55
 	}
56 56
 }
Please login to merge, or discard this patch.
plugin/Modules/Session.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 
35 35
 	public function __construct()
36 36
 	{
37
-		if( $cookieId = filter_input( INPUT_COOKIE, static::SESSION_COOKIE )) {
38
-			$cookie = explode( '||', stripslashes( $cookieId ));
37
+		if( $cookieId = filter_input( INPUT_COOKIE, static::SESSION_COOKIE ) ) {
38
+			$cookie = explode( '||', stripslashes( $cookieId ) );
39 39
 			$this->sessionId = preg_replace( '/[^A-Za-z0-9_]/', '', $cookie[0] );
40 40
 			$this->expiryTimestamp = absint( $cookie[1] );
41 41
 			$this->expiryTimestampReset = absint( $cookie[2] );
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function deleteExpiredSessions( $limit = 1000 )
77 77
 	{
78
-		if( $expiredSessions = implode( "','", $this->getExpiredSessions( $limit ))) {
78
+		if( $expiredSessions = implode( "','", $this->getExpiredSessions( $limit ) ) ) {
79 79
 			glsr( SqlQueries::class )->deleteExpiredSessions( $expiredSessions );
80 80
 		}
81 81
 	}
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 	public function get( $key, $fallback = '', $unset = false )
90 90
 	{
91 91
 		$key = sanitize_key( $key );
92
-		$value = isset( $this->sessionData[$key] )
92
+		$value = isset($this->sessionData[$key])
93 93
 			? maybe_unserialize( $this->sessionData[$key] )
94 94
 			: $fallback;
95
-		if( isset( $this->sessionData[$key] ) && $unset ) {
96
-			unset( $this->sessionData[$key] );
95
+		if( isset($this->sessionData[$key]) && $unset ) {
96
+			unset($this->sessionData[$key]);
97 97
 			$this->updateSession();
98 98
 		}
99 99
 		return $value;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	protected function deleteSession()
128 128
 	{
129 129
 		delete_option( $this->getSessionId() );
130
-		delete_option( $this->getSessionId( 'expires' ));
130
+		delete_option( $this->getSessionId( 'expires' ) );
131 131
 	}
132 132
 
133 133
 	/**
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	protected function generateSessionId()
137 137
 	{
138
-		return md5(( new PasswordHash( 8, false ))->get_random_bytes( 32 ));
138
+		return md5( (new PasswordHash( 8, false ))->get_random_bytes( 32 ) );
139 139
 	}
140 140
 
141 141
 	/**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
 	protected function getExpiredSessions( $limit )
146 146
 	{
147 147
 		$expiredSessions = [];
148
-		$sessions = glsr( SqlQueries::class )->getExpiredSessions( static::SESSION_COOKIE, absint( $limit ));
149
-		if( !empty( $sessions )) {
148
+		$sessions = glsr( SqlQueries::class )->getExpiredSessions( static::SESSION_COOKIE, absint( $limit ) );
149
+		if( !empty($sessions) ) {
150 150
 			$now = time();
151 151
 			foreach( $sessions as $session ) {
152 152
 				if( $now <= $session->expiration )continue;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 */
164 164
 	protected function getSessionId( $separator = '' )
165 165
 	{
166
-		return implode( '_', array_filter( [static::SESSION_COOKIE, $separator, $this->sessionId] ));
166
+		return implode( '_', array_filter( [static::SESSION_COOKIE, $separator, $this->sessionId] ) );
167 167
 	}
168 168
 
169 169
 	/**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 	{
195 195
 		if( headers_sent() )return;
196 196
 		$cookie = $this->sessionId.'||'.$this->expiryTimestamp.'||'.$this->expiryTimestampReset;
197
-		$cookiePath = preg_replace( '|https?://[^/]+|i', '', trailingslashit( (string)get_option( 'home' )));
197
+		$cookiePath = preg_replace( '|https?://[^/]+|i', '', trailingslashit( (string)get_option( 'home' ) ) );
198 198
 		setcookie( static::SESSION_COOKIE, $cookie, $this->expiryTimestamp, $cookiePath );
199 199
 	}
200 200
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	protected function updateSession()
214 214
 	{
215
-		if( false === get_option( $this->getSessionId() )) {
215
+		if( false === get_option( $this->getSessionId() ) ) {
216 216
 			return $this->createSession();
217 217
 		}
218 218
 		update_option( $this->getSessionId(), $this->sessionData, false );
Please login to merge, or discard this patch.
plugin/Modules/Blacklist.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
 	 */
12 12
 	public function isBlacklisted( array $review )
13 13
 	{
14
-		$target = implode( "\n", array_filter([
14
+		$target = implode( "\n", array_filter( [
15 15
 			$review['name'],
16 16
 			$review['content'],
17 17
 			$review['email'],
18 18
 			$review['ip_address'],
19 19
 			$review['title'],
20
-		]));
21
-		return (bool) apply_filters( 'site-reviews/blacklist/is-blacklisted',
20
+		] ) );
21
+		return (bool)apply_filters( 'site-reviews/blacklist/is-blacklisted',
22 22
 			$this->check( $target ),
23 23
 			$review
24 24
 		);
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	protected function check( $target )
32 32
 	{
33
-		$blacklist = trim( glsr( OptionManager::class )->get( 'settings.submissions.blacklist.entries' ));
34
-		if( empty( $blacklist )) {
33
+		$blacklist = trim( glsr( OptionManager::class )->get( 'settings.submissions.blacklist.entries' ) );
34
+		if( empty($blacklist) ) {
35 35
 			return false;
36 36
 		}
37 37
 		$lines = explode( "\n", $blacklist );
38
-		foreach( (array) $lines as $line ) {
38
+		foreach( (array)$lines as $line ) {
39 39
 			$line = trim( $line );
40
-			if( empty( $line ) || 256 < strlen( $line ))continue;
41
-			$pattern = sprintf( '#%s#i', preg_quote( $line, '#' ));
42
-			if( preg_match( $pattern, $target )) {
40
+			if( empty($line) || 256 < strlen( $line ) )continue;
41
+			$pattern = sprintf( '#%s#i', preg_quote( $line, '#' ) );
42
+			if( preg_match( $pattern, $target ) ) {
43 43
 				return true;
44 44
 			}
45 45
 		}
Please login to merge, or discard this patch.
plugin/Commands/CreateReview.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
 	public function __construct( $input )
28 28
 	{
29 29
 		$this->request = $input;
30
-		$this->ajax_request = isset( $input['ajax_request'] );
30
+		$this->ajax_request = isset($input['ajax_request']);
31 31
 		$this->assigned_to = $this->getNumeric( 'assign_to' );
32
-		$this->author = sanitize_text_field( $this->get( 'name' ));
33
-		$this->avatar = get_avatar_url( $this->get( 'email' ));
34
-		$this->blacklisted = isset( $input['blacklisted'] );
35
-		$this->category = sanitize_key( $this->get( 'category' ));
36
-		$this->content = sanitize_textarea_field( $this->get( 'content' ));
32
+		$this->author = sanitize_text_field( $this->get( 'name' ) );
33
+		$this->avatar = get_avatar_url( $this->get( 'email' ) );
34
+		$this->blacklisted = isset($input['blacklisted']);
35
+		$this->category = sanitize_key( $this->get( 'category' ) );
36
+		$this->content = sanitize_textarea_field( $this->get( 'content' ) );
37 37
 		$this->custom = $this->getCustom();
38
-		$this->email = sanitize_email( $this->get( 'email' ));
39
-		$this->form_id = sanitize_key( $this->get( 'form_id' ));
38
+		$this->email = sanitize_email( $this->get( 'email' ) );
39
+		$this->form_id = sanitize_key( $this->get( 'form_id' ) );
40 40
 		$this->ip_address = $this->get( 'ip_address' );
41
-		$this->rating = intval( $this->get( 'rating' ));
41
+		$this->rating = intval( $this->get( 'rating' ) );
42 42
 		$this->referrer = $this->get( 'referrer' );
43
-		$this->terms = isset( $input['terms'] );
44
-		$this->title = sanitize_text_field( $this->get( 'title' ));
43
+		$this->terms = isset($input['terms']);
44
+		$this->title = sanitize_text_field( $this->get( 'title' ) );
45 45
 	}
46 46
 
47 47
 	/**
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	protected function get( $key )
52 52
 	{
53
-		return isset( $this->request[$key] )
53
+		return isset($this->request[$key])
54 54
 			? (string)$this->request[$key]
55 55
 			: '';
56 56
 	}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		];
68 68
 		$custom = $this->request;
69 69
 		foreach( $unset as $value ) {
70
-			unset( $custom[$value] );
70
+			unset($custom[$value]);
71 71
 		}
72 72
 		return $custom;
73 73
 	}
Please login to merge, or discard this patch.
plugin/Modules/Html/Partials/Pagination.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 		$this->args = $this->normalize( $args );
23 23
 		if( $this->args['total'] < 2 )return;
24 24
 		$links = $this->buildLinksForDeprecatedThemes();
25
-		if( empty( $links )) {
25
+		if( empty($links) ) {
26 26
 			$links = $this->buildLinks();
27 27
 		}
28 28
 		$links = apply_filters( 'site-reviews/reviews/navigation_links', $links, $this->args );
29
-		if( empty( $links ))return;
29
+		if( empty($links) )return;
30 30
 		return $this->buildTemplate( $links );
31 31
 	}
32 32
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 			'total' => $this->args['total'],
46 46
 		];
47 47
 		if( is_front_page() ) {
48
-			unset( $paginateArgs['format'] );
48
+			unset($paginateArgs['format']);
49 49
 		}
50 50
 		return paginate_links( $paginateArgs );
51 51
 	}
@@ -56,17 +56,17 @@  discard block
 block discarded – undo
56 56
 	protected function buildLinksForDeprecatedThemes()
57 57
 	{
58 58
 		$theme = wp_get_theme()->get( 'TextDomain' );
59
-		if( !in_array( $theme, ['twentyten','twentyeleven','twentytwelve','twentythirteen'] ))return;
59
+		if( !in_array( $theme, ['twentyten', 'twentyeleven', 'twentytwelve', 'twentythirteen'] ) )return;
60 60
 		$links = '';
61 61
 		if( $this->args['paged'] > 1 ) {
62
-			$links.= sprintf( '<div class="nav-previous"><a href="%s"><span class="meta-nav">&larr;</span> %s</a></div>',
62
+			$links .= sprintf( '<div class="nav-previous"><a href="%s"><span class="meta-nav">&larr;</span> %s</a></div>',
63 63
 				$this->buildUrlForDeprecatedThemes(-1),
64 64
 				__( 'Previous', 'site-reviews' )
65 65
 			);
66 66
 		}
67 67
 		if( $this->args['paged'] < $this->args['total'] ) {
68
-			$links.= sprintf( '<div class="nav-next"><a href="%s">%s <span class="meta-nav">&rarr;</span></a></div>',
69
-				$this->buildUrlForDeprecatedThemes(1),
68
+			$links .= sprintf( '<div class="nav-next"><a href="%s">%s <span class="meta-nav">&rarr;</span></a></div>',
69
+				$this->buildUrlForDeprecatedThemes( 1 ),
70 70
 				__( 'Next', 'site-reviews' )
71 71
 			);
72 72
 		}
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$screenReaderTemplate = '<h2 class="screen-reader-text">%2$s</h2>';
85 85
 		$screenReaderText = __( 'Site Reviews navigation', 'site-reviews' );
86 86
 		$innerTemplate = $screenReaderTemplate.'<div class="nav-links">%3$s</div>';
87
-		if( in_array( $theme, ['twentyten', 'twentyeleven', 'twentytwelve'] )) {
87
+		if( in_array( $theme, ['twentyten', 'twentyeleven', 'twentytwelve'] ) ) {
88 88
 			$innerTemplate = '%3$s';
89 89
 		}
90 90
 		else if( $theme == 'twentyfourteen' ) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		$template = sprintf( $template, $class, $screenReaderText, $links );
97 97
 		return glsr( Builder::class )->div( $template.'<div class="glsr-loader"></div>', [
98 98
 			'class' => 'glsr-navigation',
99
-		]);
99
+		] );
100 100
 	}
101 101
 
102 102
 	/**
@@ -119,6 +119,6 @@  discard block
 block discarded – undo
119 119
 		return wp_parse_args( $args, [
120 120
 			'paged' => glsr( QueryBuilder::class )->getPaged(),
121 121
 			'total' => 1,
122
-		]);
122
+		] );
123 123
 	}
124 124
 }
Please login to merge, or discard this patch.
views/partials/editor/metabox-categories.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 	<div id="<?= $tax_name; ?>-all" class="tabs-panel">
17 17
 		<input type="hidden" name="tax_input[<?= $tax_name; ?>][]" value='0' />
18 18
 		<ul id="<?= $tax_name; ?>checklist" data-wp-lists="list:<?= $tax_name; ?>" class="categorychecklist form-no-clear">
19
-			<?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids )); ?>
19
+			<?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'popular_cats' => $popular_ids ) ); ?>
20 20
 		</ul>
21 21
 	</div>
22 22
 
23
-	<?php if( current_user_can( $taxonomy->cap->edit_terms )) : ?>
23
+	<?php if( current_user_can( $taxonomy->cap->edit_terms ) ) : ?>
24 24
 	<div id="<?= $tax_name; ?>-adder" class="wp-hidden-children">
25 25
 		<a id="<?= $tax_name; ?>-add-toggle" href="#<?= $tax_name; ?>-add" class="hide-if-no-js taxonomy-add-new">
26 26
 			<?= sprintf( '+ %s', $taxonomy->labels->add_new_item ); ?>
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 			<label class="screen-reader-text" for="new<?= $tax_name; ?>"><?= $taxonomy->labels->add_new_item; ?></label>
30 30
 			<input type="text" name="new<?= $tax_name; ?>" id="new<?= $tax_name; ?>" class="form-required form-input-tip" value="<?= esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/>
31 31
 			<input type="button" id="<?= $tax_name; ?>-add-submit" data-wp-lists="add:<?= $tax_name; ?>checklist:<?= $tax_name; ?>-add" class="button category-add-submit" value="<?= esc_attr( $taxonomy->labels->add_new_item ); ?>" />
32
-			<?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?>
32
+			<?php wp_nonce_field( 'add-'.$tax_name, '_ajax_nonce-add-'.$tax_name, false ); ?>
33 33
 			<span id="<?= $tax_name; ?>-ajax-response"></span>
34 34
 		</div>
35 35
 	</div>
Please login to merge, or discard this patch.
views/partials/editor/review.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php defined( 'WPINC' ) || die; ?>
2 2
 
3 3
 <div id="titlediv">
4
-	<input type="text" id="title" value="<?= $post->post_title ? esc_attr( $post->post_title ) : sprintf( '(%s)', __( 'no title', 'site-reviews' )); ?>" readonly>
4
+	<input type="text" id="title" value="<?= $post->post_title ? esc_attr( $post->post_title ) : sprintf( '(%s)', __( 'no title', 'site-reviews' ) ); ?>" readonly>
5 5
 </div>
6 6
 
7 7
 <div id="contentdiv">
Please login to merge, or discard this patch.