@@ -79,7 +79,8 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | $entries[html_entity_decode($key, ENT_COMPAT, 'UTF-8')] = $entry; |
| 81 | 81 | } |
| 82 | - } catch (Exception $e) { |
|
| 82 | + } |
|
| 83 | + catch (Exception $e) { |
|
| 83 | 84 | glsr_log()->error($e->getMessage()); |
| 84 | 85 | } |
| 85 | 86 | return $entries; |
@@ -202,7 +203,8 @@ discard block |
||
| 202 | 203 | if (in_array($needle, [$single, $plural])) { |
| 203 | 204 | $this->results[$key] = $entry; |
| 204 | 205 | } |
| 205 | - } elseif (Str::contains(sprintf('%s %s', $single, $plural), $needle)) { |
|
| 206 | + } |
|
| 207 | + elseif (Str::contains(sprintf('%s %s', $single, $plural), $needle)) { |
|
| 206 | 208 | $this->results[$key] = $entry; |
| 207 | 209 | } |
| 208 | 210 | } |
@@ -248,7 +250,8 @@ discard block |
||
| 248 | 250 | foreach ($keys as $key) { |
| 249 | 251 | try { |
| 250 | 252 | $entry = $this->normalizeEntryString($entry, $key); |
| 251 | - } catch (\TypeError $error) { |
|
| 253 | + } |
|
| 254 | + catch (\TypeError $error) { |
|
| 252 | 255 | glsr_log()->once('error', 'Translation/normalize', $error); |
| 253 | 256 | glsr_log()->once('debug', 'Translation/normalize', $entry); |
| 254 | 257 | } |
@@ -137,7 +137,8 @@ discard block |
||
| 137 | 137 | $integration->pluginName |
| 138 | 138 | )); |
| 139 | 139 | return false; |
| 140 | - } elseif (!$integration->isSupported()) { |
|
| 140 | + } |
|
| 141 | + elseif (!$integration->isSupported()) { |
|
| 141 | 142 | glsr(Notice::class)->addError(sprintf( |
| 142 | 143 | _x('Please update the %s plugin to v%s or greater to enable integration.', 'admin-text', 'site-reviews'), |
| 143 | 144 | $integration->pluginName, |
@@ -164,7 +165,8 @@ discard block |
||
| 164 | 165 | if (!$updater->isLicenseValid()) { |
| 165 | 166 | throw new Exception('Invalid license: '.$license.' ('.$addon->id.')'); |
| 166 | 167 | } |
| 167 | - } catch (Exception $e) { |
|
| 168 | + } |
|
| 169 | + catch (Exception $e) { |
|
| 168 | 170 | $license = ''; |
| 169 | 171 | glsr_log()->debug($e->getMessage()); |
| 170 | 172 | glsr(Notice::class)->addError(_x('A license you entered was invalid.', 'admin-text', 'site-reviews')); |
@@ -15,8 +15,11 @@ discard block |
||
| 15 | 15 | <span class="glsr-addon-link button button-secondary" disabled> |
| 16 | 16 | <?= _x('Installed', 'admin-text', '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 | <?= _x('Activate', 'admin-text', '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 | <?= _x('Try the beta', 'admin-text', '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 | - <?= _x('More Info', 'admin-text', 'site-reviews'); ?> |
|
| 33 | + <?= _x('More Info', 'admin-text', 'site-reviews'); |
|
| 34 | +} |
|
| 35 | +?> |
|
| 30 | 36 | </a> |
| 31 | 37 | <?php endif; ?> |
| 32 | 38 | </div> |
@@ -373,7 +373,8 @@ |
||
| 373 | 373 | } |
| 374 | 374 | if (is_array($parameter1)) { |
| 375 | 375 | $args += $parameter1; |
| 376 | - } elseif (is_array($parameter2)) { |
|
| 376 | + } |
|
| 377 | + elseif (is_array($parameter2)) { |
|
| 377 | 378 | $args += $parameter2; // does not overwrite $args['text'] |
| 378 | 379 | } |
| 379 | 380 | return $args; |
@@ -208,7 +208,8 @@ |
||
| 208 | 208 | ); |
| 209 | 209 | if ($trustalyze->success) { |
| 210 | 210 | update_option($this->trustalyzeKey, Arr::get($trustalyze->response, 'producttype')); |
| 211 | - } else { |
|
| 211 | + } |
|
| 212 | + else { |
|
| 212 | 213 | delete_option($this->trustalyzeKey); |
| 213 | 214 | $settings = Arr::set($settings, $this->enabledKey, 'no'); |
| 214 | 215 | glsr(Notice::class)->addError(sprintf( |
@@ -64,7 +64,8 @@ discard block |
||
| 64 | 64 | if ($flattenValue) { |
| 65 | 65 | $value = '['.implode(', ', $value).']'; |
| 66 | 66 | } |
| 67 | - } elseif (is_array($value)) { |
|
| 67 | + } |
|
| 68 | + elseif (is_array($value)) { |
|
| 68 | 69 | $result = array_merge($result, static::flatten($value, $flattenValue, $newKey)); |
| 69 | 70 | continue; |
| 70 | 71 | } |
@@ -198,7 +199,8 @@ discard block |
||
| 198 | 199 | while (false !== $token) { |
| 199 | 200 | if (is_object($ref)) { |
| 200 | 201 | $ref = &$ref->$token; |
| 201 | - } else { |
|
| 202 | + } |
|
| 203 | + else { |
|
| 202 | 204 | $ref = static::consolidate($ref); |
| 203 | 205 | $ref = &$ref[$token]; |
| 204 | 206 | } |
@@ -36,9 +36,11 @@ |
||
| 36 | 36 | { |
| 37 | 37 | if ('post_id' === Arr::get($attributes, $assignType)) { |
| 38 | 38 | $attributes[$assignType] = $attributes['post_id']; |
| 39 | - } elseif ('parent_id' === Arr::get($attributes, $assignType)) { |
|
| 39 | + } |
|
| 40 | + elseif ('parent_id' === Arr::get($attributes, $assignType)) { |
|
| 40 | 41 | $attributes[$assignType] = wp_get_post_parent_id($attributes['post_id']); |
| 41 | - } elseif ('custom' === Arr::get($attributes, $assignType)) { |
|
| 42 | + } |
|
| 43 | + elseif ('custom' === Arr::get($attributes, $assignType)) { |
|
| 42 | 44 | $attributes[$assignType] = Arr::get($attributes, $assignType.'_custom'); |
| 43 | 45 | } |
| 44 | 46 | return $attributes; |
@@ -167,9 +167,11 @@ |
||
| 167 | 167 | { |
| 168 | 168 | if ('parent_id' == $postId) { |
| 169 | 169 | $postId = intval(wp_get_post_parent_id(intval(get_the_ID()))); |
| 170 | - } elseif ('post_id' == $postId) { |
|
| 170 | + } |
|
| 171 | + elseif ('post_id' == $postId) { |
|
| 171 | 172 | $postId = intval(get_the_ID()); |
| 172 | - } elseif ('custom' == $postId) { |
|
| 173 | + } |
|
| 174 | + elseif ('custom' == $postId) { |
|
| 173 | 175 | $customId = Arr::get($atts, 'assigned_to_custom'); |
| 174 | 176 | $customId = str_replace('custom', '', $customId); // prevent a possible infinite loop |
| 175 | 177 | $postId = $this->normalizeAssignedTo($customId, $atts); |
@@ -318,7 +318,8 @@ |
||
| 318 | 318 | $alert = _x('Some of the shortcode options are required.', 'admin-text', 'site-reviews'); |
| 319 | 319 | if (isset($args['required']['alert'])) { |
| 320 | 320 | $alert = $args['required']['alert']; |
| 321 | - } elseif (!empty($args['label'])) { |
|
| 321 | + } |
|
| 322 | + elseif (!empty($args['label'])) { |
|
| 322 | 323 | $alert = sprintf( |
| 323 | 324 | _x('The "%s" option is required.', 'the option label (admin-text)', 'site-reviews'), |
| 324 | 325 | str_replace(':', '', $args['label']) |