@@ -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"> |
@@ -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 | } |
@@ -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,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; |
@@ -77,7 +77,9 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | public function deactivate( $plugin ) |
| 79 | 79 | { |
| 80 | - if( $this->isValid() )return; |
|
| 80 | + if( $this->isValid() ) { |
|
| 81 | + return; |
|
| 82 | + } |
|
| 81 | 83 | $pluginSlug = plugin_basename( $this->file ); |
| 82 | 84 | if( $plugin == $pluginSlug ) { |
| 83 | 85 | $this->redirect(); //exit |
@@ -44,7 +44,9 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function initConsole() |
| 46 | 46 | { |
| 47 | - if( func_get_arg(0) != Application::CONSOLE_HOOK )return; |
|
| 47 | + if( func_get_arg(0) != Application::CONSOLE_HOOK ) { |
|
| 48 | + return; |
|
| 49 | + } |
|
| 48 | 50 | $backtrace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 4 ); |
| 49 | 51 | $entry = array_pop( $backtrace ); |
| 50 | 52 | $location = ''; |
@@ -61,7 +63,9 @@ discard block |
||
| 61 | 63 | */ |
| 62 | 64 | public function initProfiler() |
| 63 | 65 | { |
| 64 | - if( func_get_arg(0) != Application::PROFILER_HOOK )return; |
|
| 66 | + if( func_get_arg(0) != Application::PROFILER_HOOK ) { |
|
| 67 | + return; |
|
| 68 | + } |
|
| 65 | 69 | $this->app->profiler->trace( func_get_arg(1) ); |
| 66 | 70 | } |
| 67 | 71 | |
@@ -174,12 +178,14 @@ discard block |
||
| 174 | 178 | */ |
| 175 | 179 | protected function getIncludedFiles() |
| 176 | 180 | { |
| 177 | - $files = array_values( array_filter( get_included_files(), function( $file ) { |
|
| 181 | + $files = array_values( array_filter( get_included_files(), function( $file ) |
|
| 182 | + { |
|
| 178 | 183 | $bool = strpos( $file, '/themes/' ) !== false |
| 179 | 184 | && strpos( $file, '/functions.php' ) === false; |
| 180 | 185 | return (bool)apply_filters( 'blackbar/templates/file', $bool, $file ); |
| 181 | 186 | })); |
| 182 | - return array_map( function( $key, $value ) { |
|
| 187 | + return array_map( function( $key, $value ) |
|
| 188 | + { |
|
| 183 | 189 | $value = str_replace( trailingslashit( WP_CONTENT_DIR ), '', $value ); |
| 184 | 190 | return sprintf( '[%s] => %s', $key, $value ); |
| 185 | 191 | }, array_keys( $files ), $files ); |
@@ -205,7 +211,8 @@ discard block |
||
| 205 | 211 | 'AND', 'FROM', 'GROUP BY', 'INNER JOIN', 'LIMIT', 'ON DUPLICATE KEY UPDATE', |
| 206 | 212 | 'ORDER BY', 'SET', 'WHERE', |
| 207 | 213 | ); |
| 208 | - $replace = array_map( function( $value ) { |
|
| 214 | + $replace = array_map( function( $value ) |
|
| 215 | + { |
|
| 209 | 216 | return PHP_EOL.$value; |
| 210 | 217 | }, $search ); |
| 211 | 218 | foreach( $wpdb->queries as $query ) { |
@@ -244,7 +251,9 @@ discard block |
||
| 244 | 251 | */ |
| 245 | 252 | protected function getTemplates() |
| 246 | 253 | { |
| 247 | - if( is_admin() )return; |
|
| 254 | + if( is_admin() ) { |
|
| 255 | + return; |
|
| 256 | + } |
|
| 248 | 257 | if( class_exists( '\GeminiLabs\Castor\Facades\Development' )) { |
| 249 | 258 | ob_start(); |
| 250 | 259 | \GeminiLabs\Castor\Facades\Development::printTemplatePaths(); |
@@ -21,7 +21,9 @@ |
||
| 21 | 21 | if( !class_exists( 'GL_Plugin_Check_v3' )) { |
| 22 | 22 | require_once __DIR__.'/activate.php'; |
| 23 | 23 | } |
| 24 | -if( !(new GL_Plugin_Check_v3( __FILE__, array( 'php' => '5.6', 'wordpress' => '4.7.0' )))->canProceed() )return; |
|
| 24 | +if( !(new GL_Plugin_Check_v3( __FILE__, array( 'php' => '5.6', 'wordpress' => '4.7.0' )))->canProceed() ) { |
|
| 25 | + return; |
|
| 26 | +} |
|
| 25 | 27 | require_once __DIR__.'/autoload.php'; |
| 26 | 28 | require_once __DIR__.'/compatibility.php'; |
| 27 | 29 | |
@@ -68,8 +68,11 @@ discard block |
||
| 68 | 68 | add_filter( 'all', array( $controller, 'initConsole' )); |
| 69 | 69 | add_filter( 'all', array( $controller, 'initProfiler' )); |
| 70 | 70 | add_action( 'plugins_loaded', array( $controller, 'registerLanguages' )); |
| 71 | - add_action( 'init', function() use( $controller ) { |
|
| 72 | - if( !apply_filters( 'blackbar/enabled', true ))return; |
|
| 71 | + add_action( 'init', function() use( $controller ) |
|
| 72 | + { |
|
| 73 | + if( !apply_filters( 'blackbar/enabled', true )) { |
|
| 74 | + return; |
|
| 75 | + } |
|
| 73 | 76 | add_action( 'admin_enqueue_scripts', array( $controller, 'enqueueAssets' )); |
| 74 | 77 | add_action( 'wp_enqueue_scripts', array( $controller, 'enqueueAssets' )); |
| 75 | 78 | add_action( 'admin_footer', array( $controller, 'renderBar' )); |
@@ -97,7 +100,9 @@ discard block |
||
| 97 | 100 | public function render( $view, array $data = array() ) |
| 98 | 101 | { |
| 99 | 102 | $file = $this->path( sprintf( 'views/%s.php', str_replace( '.php', '', $view ))); |
| 100 | - if( !file_exists( $file ))return; |
|
| 103 | + if( !file_exists( $file )) { |
|
| 104 | + return; |
|
| 105 | + } |
|
| 101 | 106 | extract( $data ); |
| 102 | 107 | include $file; |
| 103 | 108 | } |