@@ -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 errors found.', 'blackbar' ); ?></td> |
| 8 | 8 | </tr> |
| 9 | - <?php else : ?> |
|
| 9 | + <?php else { |
|
| 10 | + : ?> |
|
| 10 | 11 | <?php foreach( $errors as $error ) : ?> |
| 11 | 12 | <tr> |
| 12 | - <td class="glbb-small"><?= $error['name']; ?></td> |
|
| 13 | + <td class="glbb-small"><?= $error['name']; |
|
| 14 | +} |
|
| 15 | +?></td> |
|
| 13 | 16 | <td><?= $error['message']; ?></td> |
| 14 | 17 | </tr> |
| 15 | 18 | <?php endforeach; ?> |
@@ -85,7 +85,9 @@ |
||
| 85 | 85 | */ |
| 86 | 86 | public function deactivate( $plugin ) |
| 87 | 87 | { |
| 88 | - if( static::isValid() )return; |
|
| 88 | + if( static::isValid() ) { |
|
| 89 | + return; |
|
| 90 | + } |
|
| 89 | 91 | $pluginSlug = plugin_basename( static::$file ); |
| 90 | 92 | if( $plugin == $pluginSlug ) { |
| 91 | 93 | $this->redirect(); //exit |
@@ -91,7 +91,9 @@ |
||
| 91 | 91 | public function render( $view, array $data = array() ) |
| 92 | 92 | { |
| 93 | 93 | $file = $this->path( sprintf( 'views/%s.php', str_replace( '.php', '', $view ))); |
| 94 | - if( !file_exists( $file ))return; |
|
| 94 | + if( !file_exists( $file )) { |
|
| 95 | + return; |
|
| 96 | + } |
|
| 95 | 97 | extract( $data ); |
| 96 | 98 | include $file; |
| 97 | 99 | } |
@@ -65,7 +65,9 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function initProfiler() |
| 67 | 67 | { |
| 68 | - if( func_get_arg(0) != Application::DEBUG )return; |
|
| 68 | + if( func_get_arg(0) != Application::DEBUG ) { |
|
| 69 | + return; |
|
| 70 | + } |
|
| 69 | 71 | $this->app->profiler->trace( func_get_arg(1) ); |
| 70 | 72 | } |
| 71 | 73 | |
@@ -154,12 +156,14 @@ discard block |
||
| 154 | 156 | */ |
| 155 | 157 | protected function getIncludedFiles() |
| 156 | 158 | { |
| 157 | - $files = array_values( array_filter( get_included_files(), function( $file ) { |
|
| 159 | + $files = array_values( array_filter( get_included_files(), function( $file ) |
|
| 160 | + { |
|
| 158 | 161 | $bool = strpos( $file, '/themes/' ) !== false |
| 159 | 162 | && strpos( $file, '/functions.php' ) === false; |
| 160 | 163 | return (bool)apply_filters( 'blackbar/templates/file', $bool, $file ); |
| 161 | 164 | })); |
| 162 | - return array_map( function( $key, $value ) { |
|
| 165 | + return array_map( function( $key, $value ) |
|
| 166 | + { |
|
| 163 | 167 | $value = str_replace( trailingslashit( WP_CONTENT_DIR ), '', $value ); |
| 164 | 168 | return sprintf( '[%s] => %s', $key, $value ); |
| 165 | 169 | }, array_keys( $files ), $files ); |
@@ -185,7 +189,8 @@ discard block |
||
| 185 | 189 | 'AND', 'FROM', 'GROUP BY', 'INNER JOIN', 'LIMIT', 'ON DUPLICATE KEY UPDATE', |
| 186 | 190 | 'ORDER BY', 'SET', 'WHERE', |
| 187 | 191 | ); |
| 188 | - $replace = array_map( function( $value ) { |
|
| 192 | + $replace = array_map( function( $value ) |
|
| 193 | + { |
|
| 189 | 194 | return PHP_EOL.$value; |
| 190 | 195 | }, $search ); |
| 191 | 196 | foreach( $wpdb->queries as $query ) { |
@@ -224,7 +229,9 @@ discard block |
||
| 224 | 229 | */ |
| 225 | 230 | protected function getTemplates() |
| 226 | 231 | { |
| 227 | - if( is_admin() )return; |
|
| 232 | + if( is_admin() ) { |
|
| 233 | + return; |
|
| 234 | + } |
|
| 228 | 235 | if( class_exists( '\GeminiLabs\Castor\Facades\Development' )) { |
| 229 | 236 | ob_start(); |
| 230 | 237 | \GeminiLabs\Castor\Facades\Development::printTemplatePaths(); |
@@ -13,9 +13,13 @@ |
||
| 13 | 13 | ]; |
| 14 | 14 | foreach( $namespaces as $prefix => $base_dir ) { |
| 15 | 15 | $len = strlen( $prefix ); |
| 16 | - if( strncmp( $prefix, $class, $len ) !== 0 )continue; |
|
| 16 | + if( strncmp( $prefix, $class, $len ) !== 0 ) { |
|
| 17 | + continue; |
|
| 18 | + } |
|
| 17 | 19 | $file = $base_dir.str_replace( '\\', '/', substr( $class, $len )).'.php'; |
| 18 | - if( !file_exists( $file ))continue; |
|
| 20 | + if( !file_exists( $file )) { |
|
| 21 | + continue; |
|
| 22 | + } |
|
| 19 | 23 | require $file; |
| 20 | 24 | break; |
| 21 | 25 | } |