@@ -6,10 +6,13 @@ |
||
6 | 6 | <tr> |
7 | 7 | <td><?= __('No entries found.', 'blackbar'); ?></td> |
8 | 8 | </tr> |
9 | - <?php else : ?> |
|
9 | + <?php else { |
|
10 | + : ?> |
|
10 | 11 | <?php foreach ($entries as $entry) : ?> |
11 | 12 | <tr> |
12 | - <td class="glbb-small"><?= $entry['name']; ?></td> |
|
13 | + <td class="glbb-small"><?= $entry['name']; |
|
14 | +} |
|
15 | +?></td> |
|
13 | 16 | <td><pre><?= $entry['message']; ?></pre></td> |
14 | 17 | </tr> |
15 | 18 | <?php endforeach; ?> |
@@ -6,14 +6,17 @@ |
||
6 | 6 | <tr> |
7 | 7 | <td><?= __('No entries found.', 'blackbar'); ?></td> |
8 | 8 | </tr> |
9 | - <?php else : ?> |
|
9 | + <?php else { |
|
10 | + : ?> |
|
10 | 11 | <?php foreach ($actions->getMeasure() as $hook => $flow) : ?> |
11 | 12 | <tr> |
12 | 13 | <td class="glbb-smalls"><?php |
13 | 14 | // glsr_log($flow); |
14 | 15 | ?></td> |
15 | 16 | </tr> |
16 | - <?php endforeach; ?> |
|
17 | + <?php endforeach; |
|
18 | +} |
|
19 | +?> |
|
17 | 20 | <?php endif; ?> |
18 | 21 | </tbody> |
19 | 22 | </table> |
@@ -8,9 +8,12 @@ |
||
8 | 8 | </tr> |
9 | 9 | </tbody> |
10 | 10 | </table> |
11 | -<?php else : ?> |
|
11 | +<?php else { |
|
12 | + : ?> |
|
12 | 13 | <form method="get" class="glbb-queries-filter"> |
13 | - <input type="text" name="glbb_query_filter" id="glbb_query_filter" placeholder="<?= __('Find queries containing', 'blackbar'); ?>"> |
|
14 | + <input type="text" name="glbb_query_filter" id="glbb_query_filter" placeholder="<?= __('Find queries containing', 'blackbar'); |
|
15 | +} |
|
16 | +?>"> |
|
14 | 17 | <input type="text" name="glbb_query_min_time" id="glbb_query_min_time" placeholder="<?= __('Minimum Execution Time', 'blackbar'); ?>"> |
15 | 18 | </form> |
16 | 19 | <table class="glbb-queries-table"> |
@@ -6,10 +6,13 @@ |
||
6 | 6 | <tr> |
7 | 7 | <td><?= __('No entries found.', 'blackbar'); ?></td> |
8 | 8 | </tr> |
9 | - <?php else : ?> |
|
9 | + <?php else { |
|
10 | + : ?> |
|
10 | 11 | <?php foreach ($profiler->getMeasure() as $timer) : ?> |
11 | 12 | <tr> |
12 | - <td><?= $profiler->getNameString($timer); ?></td> |
|
13 | + <td><?= $profiler->getNameString($timer); |
|
14 | +} |
|
15 | +?></td> |
|
13 | 16 | <td class="glbb-medium"><?= $profiler->getTimeString($timer); ?></td> |
14 | 17 | <td class="glbb-medium"><?= $profiler->getMemoryString($timer); ?></td> |
15 | 18 | </tr> |
@@ -5,7 +5,8 @@ |
||
5 | 5 | /* |
6 | 6 | * PSR-4 autoloader |
7 | 7 | */ |
8 | -spl_autoload_register(function ($class) { |
|
8 | +spl_autoload_register(function ($class) |
|
9 | +{ |
|
9 | 10 | $namespaces = [ |
10 | 11 | 'GeminiLabs\\BlackBar\\' => __DIR__.'/src/', |
11 | 12 | 'GeminiLabs\\BlackBar\\Tests\\' => __DIR__.'/tests/', |
@@ -6,7 +6,8 @@ discard block |
||
6 | 6 | * @return array |
7 | 7 | * @see https://docs.gravityforms.com/gform_noconflict_scripts/ |
8 | 8 | */ |
9 | -add_filter('gform_noconflict_scripts', function (array $scripts) { |
|
9 | +add_filter('gform_noconflict_scripts', function (array $scripts) |
|
10 | +{ |
|
10 | 11 | $scripts[] = 'blackbar'; |
11 | 12 | return $scripts; |
12 | 13 | }); |
@@ -15,7 +16,8 @@ discard block |
||
15 | 16 | * @return array |
16 | 17 | * @see https://docs.gravityforms.com/gform_noconflict_styles/ |
17 | 18 | */ |
18 | -add_filter('gform_noconflict_styles', function (array $styles) { |
|
19 | +add_filter('gform_noconflict_styles', function (array $styles) |
|
20 | +{ |
|
19 | 21 | $styles[] = 'blackbar'; |
20 | 22 | $styles[] = 'blackbar-syntax'; |
21 | 23 | return $styles; |
@@ -38,7 +38,8 @@ discard block |
||
38 | 38 | $hash = md5($errno.$errstr.$errfile.$errline); |
39 | 39 | if (array_key_exists($hash, $this->errors)) { |
40 | 40 | ++$this->errors[$hash]['count']; |
41 | - } else { |
|
41 | + } |
|
42 | + else { |
|
42 | 43 | $this->errors[$hash] = array( |
43 | 44 | 'errno' => $errno, |
44 | 45 | 'message' => $errstr, |
@@ -60,7 +61,8 @@ discard block |
||
60 | 61 | add_filter('all', array($controller, 'initProfiler')); |
61 | 62 | add_filter('all', array($controller, 'measureSlowActions')); |
62 | 63 | add_action('plugins_loaded', array($controller, 'registerLanguages')); |
63 | - add_action('init', function () use ($controller) { |
|
64 | + add_action('init', function () use ($controller) |
|
65 | + { |
|
64 | 66 | if (!apply_filters('blackbar/enabled', true)) { |
65 | 67 | return; |
66 | 68 | } |
@@ -191,12 +191,14 @@ discard block |
||
191 | 191 | */ |
192 | 192 | protected function getIncludedFiles() |
193 | 193 | { |
194 | - $files = array_values(array_filter(get_included_files(), function ($file) { |
|
194 | + $files = array_values(array_filter(get_included_files(), function ($file) |
|
195 | + { |
|
195 | 196 | $bool = false !== strpos($file, '/themes/') |
196 | 197 | && false === strpos($file, '/functions.php'); |
197 | 198 | return (bool) apply_filters('blackbar/templates/file', $bool, $file); |
198 | 199 | })); |
199 | - return array_map(function ($key, $value) { |
|
200 | + return array_map(function ($key, $value) |
|
201 | + { |
|
200 | 202 | $value = str_replace(trailingslashit(WP_CONTENT_DIR), '', $value); |
201 | 203 | return sprintf('[%s] => %s', $key, $value); |
202 | 204 | }, array_keys($files), $files); |
@@ -226,7 +228,8 @@ discard block |
||
226 | 228 | 'AND', 'FROM', 'GROUP BY', 'INNER JOIN', 'LIMIT', 'ON DUPLICATE KEY UPDATE', |
227 | 229 | 'ORDER BY', 'SET', 'WHERE', |
228 | 230 | ); |
229 | - $replace = array_map(function ($value) { |
|
231 | + $replace = array_map(function ($value) |
|
232 | + { |
|
230 | 233 | return PHP_EOL.$value; |
231 | 234 | }, $search); |
232 | 235 | foreach ($wpdb->queries as $query) { |
@@ -74,9 +74,11 @@ |
||
74 | 74 | $object = get_class($object); |
75 | 75 | } |
76 | 76 | $this->flow[$action]['callbacks'][$priority][] = sprintf('%s::%s', $object, $method); |
77 | - } elseif (is_object($callback['function'])) { |
|
77 | + } |
|
78 | + elseif (is_object($callback['function'])) { |
|
78 | 79 | $this->flow[$action]['callbacks'][$priority][] = get_class($callback['function']); |
79 | - } else { |
|
80 | + } |
|
81 | + else { |
|
80 | 82 | $this->flow[$action]['callbacks'][$priority][] = $callback['function']; |
81 | 83 | } |
82 | 84 | ++$this->flow[$action]['callbacks_count']; |