@@ -19,7 +19,8 @@ |
||
19 | 19 | if (is_null($command->pinned)) { |
20 | 20 | $meta = glsr(Database::class)->get($command->id, 'pinned'); |
21 | 21 | $command->pinned = !wp_validate_boolean($meta); |
22 | - } else { |
|
22 | + } |
|
23 | + else { |
|
23 | 24 | $notice = $command->pinned |
24 | 25 | ? __('Review pinned.', 'site-reviews') |
25 | 26 | : __('Review unpinned.', 'site-reviews'); |
@@ -194,7 +194,8 @@ |
||
194 | 194 | $dateFormat = $this->getOption('settings.reviews.date.format', 'default'); |
195 | 195 | if ('relative' == $dateFormat) { |
196 | 196 | $date = glsr(Date::class)->relative($value); |
197 | - } else { |
|
197 | + } |
|
198 | + else { |
|
198 | 199 | $format = 'custom' == $dateFormat |
199 | 200 | ? $this->getOption('settings.reviews.date.custom', 'M j, Y') |
200 | 201 | : glsr(OptionManager::class)->getWP('date_format', 'F j, Y'); |
@@ -134,7 +134,8 @@ |
||
134 | 134 | ['context' => $this->email['template-tags']], |
135 | 135 | $this->email['template'] |
136 | 136 | ); |
137 | - } elseif ($this->email['template']) { |
|
137 | + } |
|
138 | + elseif ($this->email['template']) { |
|
138 | 139 | $message = glsr(Template::class)->build('templates/'.$this->email['template'], [ |
139 | 140 | 'context' => $this->email['template-tags'], |
140 | 141 | ]); |
@@ -74,7 +74,8 @@ discard block |
||
74 | 74 | foreach ($potEntries as $key => $entry) { |
75 | 75 | $entries[html_entity_decode($key, ENT_COMPAT, 'UTF-8')] = $entry; |
76 | 76 | } |
77 | - } catch (Exception $e) { |
|
77 | + } |
|
78 | + catch (Exception $e) { |
|
78 | 79 | glsr_log()->error($e->getMessage()); |
79 | 80 | } |
80 | 81 | return $entries; |
@@ -197,7 +198,8 @@ discard block |
||
197 | 198 | if (in_array($needle, [$single, $plural])) { |
198 | 199 | $this->results[$key] = $entry; |
199 | 200 | } |
200 | - } elseif (Str::contains(sprintf('%s %s', $single, $plural), $needle)) { |
|
201 | + } |
|
202 | + elseif (Str::contains(sprintf('%s %s', $single, $plural), $needle)) { |
|
201 | 203 | $this->results[$key] = $entry; |
202 | 204 | } |
203 | 205 | } |
@@ -243,7 +245,8 @@ discard block |
||
243 | 245 | foreach ($keys as $key) { |
244 | 246 | try { |
245 | 247 | $entry = $this->normalizeEntryString($entry, $key); |
246 | - } catch (\TypeError $error) { |
|
248 | + } |
|
249 | + catch (\TypeError $error) { |
|
247 | 250 | glsr_log()->once('error', 'Translation/normalize', $error); |
248 | 251 | glsr_log()->once('debug', 'Translation/normalize', $entry); |
249 | 252 | } |
@@ -125,7 +125,8 @@ |
||
125 | 125 | sprintf($messages['wrong_version'], $messages['php_version'].' '.$this->versions['php']), |
126 | 126 | sprintf($messages['update_php'], PHP_VERSION).'</p><p>'.$rollbackMessage |
127 | 127 | ); |
128 | - } elseif (!$this->isWpValid()) { |
|
128 | + } |
|
129 | + elseif (!$this->isWpValid()) { |
|
129 | 130 | printf($noticeTemplate, |
130 | 131 | sprintf($messages['notice'], $pluginName), |
131 | 132 | sprintf($messages['wrong_version'], $messages['wp_version'].' '.$this->versions['wordpress']), |
@@ -134,7 +134,8 @@ discard block |
||
134 | 134 | $integration->pluginName |
135 | 135 | )); |
136 | 136 | return false; |
137 | - } elseif (!$integration->isSupported()) { |
|
137 | + } |
|
138 | + elseif (!$integration->isSupported()) { |
|
138 | 139 | glsr(Notice::class)->addError(sprintf( |
139 | 140 | __('Please update the %s plugin to v%s or greater to enable integration.', 'site-reviews'), |
140 | 141 | $integration->pluginName, |
@@ -161,7 +162,8 @@ discard block |
||
161 | 162 | if (!$updater->isLicenseValid()) { |
162 | 163 | throw new Exception('Invalid license: '.$license.' ('.$addon->id.')'); |
163 | 164 | } |
164 | - } catch (Exception $e) { |
|
165 | + } |
|
166 | + catch (Exception $e) { |
|
165 | 167 | $license = ''; |
166 | 168 | glsr_log()->debug($e->getMessage()); |
167 | 169 | glsr(Notice::class)->addError(__('A license you entered was invalid.', 'site-reviews')); |
@@ -207,7 +207,8 @@ |
||
207 | 207 | $this->bind($id, $addon); |
208 | 208 | $addon->init(); |
209 | 209 | } |
210 | - } catch(\ReflectionException $e) { |
|
210 | + } |
|
211 | + catch(\ReflectionException $e) { |
|
211 | 212 | glsr_log()->error('Attempted to register an invalid addon.'); |
212 | 213 | } |
213 | 214 | } |
@@ -64,7 +64,8 @@ |
||
64 | 64 | $review = glsr_get_review($post); |
65 | 65 | if ('publish' == $post->post_status) { |
66 | 66 | glsr(CountsManager::class)->increaseAll($review); |
67 | - } else { |
|
67 | + } |
|
68 | + else { |
|
68 | 69 | glsr(CountsManager::class)->decreaseAll($review); |
69 | 70 | } |
70 | 71 | } |
@@ -15,8 +15,11 @@ discard block |
||
15 | 15 | <span class="glsr-addon-link button button-secondary" disabled> |
16 | 16 | <?= __('Installed', 'site-reviews'); ?> |
17 | 17 | </span> |
18 | - <?php else: ?> |
|
19 | - <a href="<?= wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin='.$plugin), 'activate-plugin_'.$plugin); ?>" class="glsr-addon-link button button-secondary"> |
|
18 | + <?php else { |
|
19 | + : ?> |
|
20 | + <a href="<?= wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin='.$plugin), 'activate-plugin_'.$plugin); |
|
21 | +} |
|
22 | +?>" class="glsr-addon-link button button-secondary"> |
|
20 | 23 | <?= __('Activate', 'site-reviews'); ?> |
21 | 24 | </a> |
22 | 25 | <?php endif; ?> |
@@ -24,9 +27,12 @@ discard block |
||
24 | 27 | <a href="mailto:[email protected]?subject=I%20would%20like%20to%20become%20a%20beta%20tester%20({{ slug }})" class="glsr-addon-link glsr-external button button-secondary"> |
25 | 28 | <?= __('Try the beta', 'site-reviews'); ?> |
26 | 29 | </a> |
27 | - <?php else: ?> |
|
30 | + <?php else { |
|
31 | + : ?> |
|
28 | 32 | <a href="{{ link }}" class="glsr-addon-link glsr-external button button-secondary"> |
29 | - <?= __('More Info', 'site-reviews'); ?> |
|
33 | + <?= __('More Info', 'site-reviews'); |
|
34 | +} |
|
35 | +?> |
|
30 | 36 | </a> |
31 | 37 | <?php endif; ?> |
32 | 38 | </div> |