Passed
Push — master ( c272a3...f1c4a0 )
by Paul
07:09
created
plugin/Database/Cache.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
 			$ipAddresses = array_fill_keys( ['v4', 'v6'], [] );
20 20
 			foreach( array_keys( $ipAddresses ) as $version ) {
21 21
 				$response = wp_remote_get( 'https://www.cloudflare.com/ips-'.$version );
22
-				if( is_wp_error( $response )) {
22
+				if( is_wp_error( $response ) ) {
23 23
 					glsr_log()->error( $response->get_error_message() );
24 24
 					continue;
25 25
 				}
26
-				$ipAddresses[$version] = array_filter( explode( PHP_EOL, wp_remote_retrieve_body( $response )));
26
+				$ipAddresses[$version] = array_filter( explode( PHP_EOL, wp_remote_retrieve_body( $response ) ) );
27 27
 			}
28 28
 			set_transient( Application::ID.'_cloudflare_ips', $ipAddresses, static::EXPIRY_TIME );
29 29
 		}
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		if( $test === false ) {
58 58
 			$response = wp_remote_post( 'https://api.wordpress.org/stats/php/1.0/' );
59 59
 			$test = !is_wp_error( $response )
60
-				&& in_array( $response['response']['code'], range( 200, 299 ))
60
+				&& in_array( $response['response']['code'], range( 200, 299 ) )
61 61
 				? 'Works'
62 62
 				: 'Does not work';
63 63
 			set_transient( Application::ID.'_remote_post_test', $test, static::EXPIRY_TIME );
Please login to merge, or discard this patch.
views/pages/addons/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 				'name' => 'tripadvisor',
13 13
 				'title' => 'Tripadvisor Reviews',
14 14
 			],
15
-		]);
15
+		] );
16 16
 		$template->render( 'partials/addons/addon', [
17 17
 			'context' => [
18 18
 				'description' => __( 'Sync your Yelp reviews and display them on your site.', 'site-reviews' ),
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 				'name' => 'yelp',
21 21
 				'title' => 'Yelp Reviews',
22 22
 			],
23
-		]);
23
+		] );
24 24
 	?>
25 25
 	</div>
26 26
 </div>
Please login to merge, or discard this patch.
views/partials/translations/plural.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 		<p>{{ data.s1 }}</p>
4 4
 		<p>{{ data.p1 }}</p>
5 5
 		<p class="row-actions">
6
-			<span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' );?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span>
6
+			<span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' ); ?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span>
7 7
 		</p>
8 8
 		<button type="button" class="toggle-row">
9 9
 			<span class="screen-reader-text"><?= __( 'Show custom translation', 'site-reviews' ); ?></span>
Please login to merge, or discard this patch.
views/partials/translations/single.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 	<td class="glsr-string-td1 column-primary">
3 3
 		<p>{{ data.s1 }}</p>
4 4
 		<p class="row-actions">
5
-			<span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' );?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span>
5
+			<span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' ); ?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span>
6 6
 		</p>
7 7
 		<button type="button" class="toggle-row">
8 8
 			<span class="screen-reader-text"><?= __( 'Show custom translation', 'site-reviews' ); ?></span>
Please login to merge, or discard this patch.
views/partials/editor/metabox-categories.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
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/email/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php defined( 'WPINC' ) || die;
2 2
 
3
-include trailingslashit(__DIR__).'header.php';
4
-include trailingslashit(__DIR__).'body.php';
5
-include trailingslashit(__DIR__).'footer.php';
3
+include trailingslashit( __DIR__ ).'header.php';
4
+include trailingslashit( __DIR__ ).'body.php';
5
+include trailingslashit( __DIR__ ).'footer.php';
Please login to merge, or discard this patch.
plugin/Modules/Email.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 		$this->message = $this->buildHtmlMessage( $email );
44 44
 		$this->subject = $email['subject'];
45 45
 		$this->to = $email['to'];
46
-		add_action( 'phpmailer_init', [ $this, 'buildPlainTextMessage'] );
46
+		add_action( 'phpmailer_init', [$this, 'buildPlainTextMessage'] );
47 47
 		return $this;
48 48
 	}
49 49
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function buildPlainTextMessage( $phpmailer )
85 85
 	{
86
-		if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody ))return;
86
+		if( $phpmailer->ContentType === 'text/plain' || !empty($phpmailer->AltBody) )return;
87 87
 		$message = $this->stripHtmlTags( $phpmailer->Body );
88 88
 		$phpmailer->AltBody = apply_filters( 'site-reviews/email/message', $message, 'text', $this );
89 89
 	}
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 			'from',
100 100
 			'reply-to',
101 101
 		];
102
-		$headers = array_intersect_key( $email, array_flip( $allowed ));
102
+		$headers = array_intersect_key( $email, array_flip( $allowed ) );
103 103
 		$headers = array_filter( $headers );
104 104
 		foreach( $headers as $key => $value ) {
105
-			unset( $headers[ $key ] );
105
+			unset($headers[$key]);
106 106
 			$headers[] = "{$key}: {$value}";
107 107
 		}
108 108
 		$headers[] = 'Content-Type: text/html';
@@ -114,16 +114,16 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	protected function buildHtmlMessage( $email )
116 116
 	{
117
-		$template = trim( glsr( OptionManager::class )->get( 'settings.general.notification_message' ));
118
-		if( !empty( $template )) {
117
+		$template = trim( glsr( OptionManager::class )->get( 'settings.general.notification_message' ) );
118
+		if( !empty($template) ) {
119 119
 			$message = glsr( Template::class )->interpolate( $template, $email['template-tags'] );
120 120
 		}
121 121
 		else if( $email['template'] ) {
122 122
 			$message = glsr( Template::class )->build( 'templates/'.$email['template'], [
123 123
 				'context' => $email['template-tags'],
124
-			]);
124
+			] );
125 125
 		}
126
-		if( !isset( $message )) {
126
+		if( !isset($message) ) {
127 127
 			$message = $email['message'];
128 128
 		}
129 129
 		$message = $email['before'].$message.$email['after'];
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		$message = str_replace( ']]>', ']]&gt;', $message );
135 135
 		$message = glsr( Template::class )->build( 'partials/email/index', [
136 136
 			'context' => ['message' => $message],
137
-		]);
137
+		] );
138 138
 		return apply_filters( 'site-reviews/email/message', stripslashes( $message ), 'html', $this );
139 139
 	}
140 140
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			'to' => '',
161 161
 		];
162 162
 		$email = shortcode_atts( $defaults, $email );
163
-		if( empty( $email['reply-to'] )) {
163
+		if( empty($email['reply-to']) ) {
164 164
 			$email['reply-to'] = $email['from'];
165 165
 		}
166 166
 		return apply_filters( 'site-reviews/email/compose', $email, $this );
Please login to merge, or discard this patch.
uninstall.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 defined( 'WP_UNINSTALL_PLUGIN' ) || die;
4 4
 
5 5
 require_once __DIR__.'/site-reviews.php';
6
-if( !GL_Plugin_Check_v1::isValid( array( 'wordpress' => '4.7.0' )))return;
6
+if( !GL_Plugin_Check_v1::isValid( array( 'wordpress' => '4.7.0' ) ) )return;
7 7
 
8 8
 delete_option( GeminiLabs\SiteReviews\Database\OptionManager::databaseKey() );
9 9
 delete_option( 'widget_'.glsr()->id.'_site-reviews' );
Please login to merge, or discard this patch.
plugin/Controllers/SettingsController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
 			return $input;
22 22
 		}
23 23
 		$triggered = true;
24
-		if( !is_array( $input )) {
24
+		if( !is_array( $input ) ) {
25 25
 			$input = ['settings' => []];
26 26
 		}
27 27
 		if( key( $input ) == 'settings' ) {
28
-			glsr( Notice::class )->addSuccess( __( 'Settings updated.', 'site-reviews' ));
28
+			glsr( Notice::class )->addSuccess( __( 'Settings updated.', 'site-reviews' ) );
29 29
 		}
30 30
 		$options = array_replace_recursive( glsr( OptionManager::class )->all(), $input );
31 31
 		$options = $this->sanitizeSubmissions( $input, $options );
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	{
42 42
 		register_setting( Application::ID.'-settings', OptionManager::databaseKey(), [
43 43
 			'sanitize_callback' => [$this, 'callbackRegisterSettings'],
44
-		]);
44
+		] );
45 45
 	}
46 46
 
47 47
 	/**
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	protected function sanitizeSubmissions( array $input, array $options )
51 51
 	{
52
-		if( isset( $input['settings']['submissions'] )) {
52
+		if( isset($input['settings']['submissions']) ) {
53 53
 			$inputForm = $input['settings']['submissions'];
54
-			$options['settings']['submissions']['required'] = isset( $inputForm['required'] )
54
+			$options['settings']['submissions']['required'] = isset($inputForm['required'])
55 55
 				? $inputForm['required']
56 56
 				: [];
57 57
 		}
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
 	 */
64 64
 	protected function sanitizeTranslations( array $input, array $options )
65 65
 	{
66
-		if( isset( $input['settings']['strings'] )) {
67
-			$options['settings']['strings'] = array_values( array_filter( $input['settings']['strings'] ));
66
+		if( isset($input['settings']['strings']) ) {
67
+			$options['settings']['strings'] = array_values( array_filter( $input['settings']['strings'] ) );
68 68
 			array_walk( $options['settings']['strings'], function( &$string ) {
69
-				if( isset( $string['s2'] )) {
69
+				if( isset($string['s2']) ) {
70 70
 					$string['s2'] = wp_strip_all_tags( $string['s2'] );
71 71
 				}
72
-				if( isset( $string['p2'] )) {
72
+				if( isset($string['p2']) ) {
73 73
 					$string['p2'] = wp_strip_all_tags( $string['p2'] );
74 74
 				}
75 75
 			});
Please login to merge, or discard this patch.