@@ -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> |
@@ -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; |
@@ -2,7 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | defined('WPINC') || die; |
| 4 | 4 | |
| 5 | -spl_autoload_register(function ($className) { |
|
| 5 | +spl_autoload_register(function ($className) |
|
| 6 | +{ |
|
| 6 | 7 | $namespaces = [ |
| 7 | 8 | 'GeminiLabs\\BlackBar\\' => __DIR__.'/plugin/', |
| 8 | 9 | 'GeminiLabs\\BlackBar\\Tests\\' => __DIR__.'/tests/', |
@@ -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']; |
@@ -124,7 +124,8 @@ |
||
| 124 | 124 | sprintf($messages['wrong_version'], $messages['php_version'].' '.$this->versions['php']), |
| 125 | 125 | sprintf($messages['update_php'], PHP_VERSION).'</p><p>'.$rollbackMessage |
| 126 | 126 | ); |
| 127 | - } elseif (!$this->isWpValid()) { |
|
| 127 | + } |
|
| 128 | + elseif (!$this->isWpValid()) { |
|
| 128 | 129 | printf($noticeTemplate, |
| 129 | 130 | sprintf($messages['notice'], $pluginName), |
| 130 | 131 | sprintf($messages['wrong_version'], $messages['wp_version'].' '.$this->versions['wordpress']), |
@@ -169,12 +169,14 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | protected function getIncludedFiles(): array |
| 171 | 171 | { |
| 172 | - $files = array_values(array_filter(get_included_files(), function ($file) { |
|
| 172 | + $files = array_values(array_filter(get_included_files(), function ($file) |
|
| 173 | + { |
|
| 173 | 174 | $bool = false !== strpos($file, '/themes/') |
| 174 | 175 | && false === strpos($file, '/functions.php'); |
| 175 | 176 | return (bool) apply_filters('blackbar/templates/file', $bool, $file); |
| 176 | 177 | })); |
| 177 | - return array_map(function ($key, $value) { |
|
| 178 | + return array_map(function ($key, $value) |
|
| 179 | + { |
|
| 178 | 180 | $value = str_replace(trailingslashit(WP_CONTENT_DIR), '', $value); |
| 179 | 181 | return sprintf('[%s] => %s', $key, $value); |
| 180 | 182 | }, array_keys($files), $files); |
@@ -198,7 +200,8 @@ discard block |
||
| 198 | 200 | 'AND', 'FROM', 'GROUP BY', 'INNER JOIN', 'LEFT JOIN', 'LIMIT', |
| 199 | 201 | 'ON DUPLICATE KEY UPDATE', 'ORDER BY', 'OFFSET', ' SET', 'WHERE', |
| 200 | 202 | ]; |
| 201 | - $replace = array_map(function ($value) { |
|
| 203 | + $replace = array_map(function ($value) |
|
| 204 | + { |
|
| 202 | 205 | return PHP_EOL.$value; |
| 203 | 206 | }, $search); |
| 204 | 207 | foreach ($wpdb->queries as $query) { |