@@ -18,14 +18,14 @@ |
||
| 18 | 18 | |
| 19 | 19 | defined( 'WPINC' ) || die; |
| 20 | 20 | |
| 21 | -if( !class_exists( 'GL_Plugin_Check_v3' )) { |
|
| 22 | - require_once __DIR__.'/activate.php'; |
|
| 21 | +if( !class_exists( 'GL_Plugin_Check_v3' ) ) { |
|
| 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; |
|
| 25 | -require_once __DIR__.'/autoload.php'; |
|
| 26 | -require_once __DIR__.'/compatibility.php'; |
|
| 24 | +if( !( new GL_Plugin_Check_v3( __FILE__, array( 'php' => '5.6', 'wordpress' => '4.7.0' ) ) )->canProceed() )return; |
|
| 25 | +require_once __DIR__ . '/autoload.php'; |
|
| 26 | +require_once __DIR__ . '/compatibility.php'; |
|
| 27 | 27 | |
| 28 | -if( !defined( 'SAVEQUERIES' )) { |
|
| 28 | +if( !defined( 'SAVEQUERIES' ) ) { |
|
| 29 | 29 | define( 'SAVEQUERIES', 1 ); |
| 30 | 30 | } |
| 31 | -(new GeminiLabs\BlackBar\Application)->init(); |
|
| 31 | +( new GeminiLabs\BlackBar\Application )->init(); |
|
@@ -5,23 +5,23 @@ |
||
| 5 | 5 | |
| 6 | 6 | <a href="javascript:Blackbar.switchPanel('glbb-console')" class="glbb-console"><?= $consoleLabel; ?></a> |
| 7 | 7 | <div id="glbb-console" class="glbb-debug-panel"> |
| 8 | - <?php $blackbar->render( 'panels/console', array( 'entries' => $consoleEntries )); ?> |
|
| 8 | + <?php $blackbar->render( 'panels/console', array( 'entries' => $consoleEntries ) ); ?> |
|
| 9 | 9 | </div> |
| 10 | 10 | |
| 11 | 11 | <a href="javascript:Blackbar.switchPanel('glbb-profiler')" class="glbb-profiler"><?= $profilerLabel; ?></a> |
| 12 | 12 | <div id="glbb-profiler" class="glbb-debug-panel"> |
| 13 | - <?php $blackbar->render( 'panels/profiler', array( 'profiler' => $profiler )); ?> |
|
| 13 | + <?php $blackbar->render( 'panels/profiler', array( 'profiler' => $profiler ) ); ?> |
|
| 14 | 14 | </div> |
| 15 | 15 | |
| 16 | 16 | <a href="javascript:Blackbar.switchPanel('glbb-queries')" class="glbb-queries"><?= $queriesLabel; ?></a> |
| 17 | 17 | <div id="glbb-queries" class="glbb-debug-panel"> |
| 18 | - <?php $blackbar->render( 'panels/queries', array( 'queries' => $queries )); ?> |
|
| 18 | + <?php $blackbar->render( 'panels/queries', array( 'queries' => $queries ) ); ?> |
|
| 19 | 19 | </div> |
| 20 | 20 | |
| 21 | 21 | <?php if( !is_admin() ) : ?> |
| 22 | 22 | <a href="javascript:Blackbar.switchPanel('glbb-templates')" class="glbb-templates"><?= __( 'Templates', 'blackbar' ); ?></a> |
| 23 | 23 | <div id="glbb-templates" class="glbb-debug-panel"> |
| 24 | - <?php $blackbar->render( 'panels/templates', array( 'templates' => $templates )); ?> |
|
| 24 | + <?php $blackbar->render( 'panels/templates', array( 'templates' => $templates ) ); ?> |
|
| 25 | 25 | </div> |
| 26 | 26 | <?php endif; ?> |
| 27 | 27 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | public function __construct() |
| 22 | 22 | { |
| 23 | 23 | $this->console = new Console; |
| 24 | - $this->file = realpath( dirname( __DIR__ ).'/'.static::ID.'.php' ); |
|
| 24 | + $this->file = realpath( dirname( __DIR__ ) . '/' . static::ID . '.php' ); |
|
| 25 | 25 | $this->profiler = new Profiler; |
| 26 | 26 | } |
| 27 | 27 | |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | 8192 => 'Deprecated', //E_DEPRECATED |
| 42 | 42 | ); |
| 43 | 43 | $errname = array_key_exists( $errno, $errorCodes ) |
| 44 | - ? $errorCodes[$errno] |
|
| 44 | + ? $errorCodes[ $errno ] |
|
| 45 | 45 | : 'Unknown'; |
| 46 | - $hash = md5( $errno.$errstr.$errfile.$errline ); |
|
| 47 | - if( array_key_exists( $hash, $this->errors )) { |
|
| 48 | - $this->errors[$hash]['count']++; |
|
| 46 | + $hash = md5( $errno . $errstr . $errfile . $errline ); |
|
| 47 | + if( array_key_exists( $hash, $this->errors ) ) { |
|
| 48 | + $this->errors[ $hash ][ 'count' ]++; |
|
| 49 | 49 | } |
| 50 | 50 | else { |
| 51 | - $this->errors[$hash] = array( |
|
| 51 | + $this->errors[ $hash ] = array( |
|
| 52 | 52 | "errno" => $errno, |
| 53 | 53 | "message" => $errstr, |
| 54 | 54 | "file" => $errfile, |
@@ -65,20 +65,20 @@ discard block |
||
| 65 | 65 | public function init() |
| 66 | 66 | { |
| 67 | 67 | $controller = new Controller( $this ); |
| 68 | - add_filter( 'all', array( $controller, 'initConsole' )); |
|
| 69 | - add_filter( 'all', array( $controller, 'initProfiler' )); |
|
| 70 | - add_action( 'plugins_loaded', array( $controller, 'registerLanguages' )); |
|
| 68 | + add_filter( 'all', array( $controller, 'initConsole' ) ); |
|
| 69 | + add_filter( 'all', array( $controller, 'initProfiler' ) ); |
|
| 70 | + add_action( 'plugins_loaded', array( $controller, 'registerLanguages' ) ); |
|
| 71 | 71 | add_action( 'init', function() use( $controller ) { |
| 72 | - if( !apply_filters( 'blackbar/enabled', true ))return; |
|
| 73 | - add_action( 'admin_enqueue_scripts', array( $controller, 'enqueueAssets' )); |
|
| 74 | - add_action( 'wp_enqueue_scripts', array( $controller, 'enqueueAssets' )); |
|
| 75 | - add_action( 'admin_footer', array( $controller, 'renderBar' )); |
|
| 76 | - add_action( 'wp_footer', array( $controller, 'renderBar' )); |
|
| 77 | - add_filter( 'admin_body_class', array( $controller, 'filterBodyClasses' )); |
|
| 72 | + if( !apply_filters( 'blackbar/enabled', true ) )return; |
|
| 73 | + add_action( 'admin_enqueue_scripts', array( $controller, 'enqueueAssets' ) ); |
|
| 74 | + add_action( 'wp_enqueue_scripts', array( $controller, 'enqueueAssets' ) ); |
|
| 75 | + add_action( 'admin_footer', array( $controller, 'renderBar' ) ); |
|
| 76 | + add_action( 'wp_footer', array( $controller, 'renderBar' ) ); |
|
| 77 | + add_filter( 'admin_body_class', array( $controller, 'filterBodyClasses' ) ); |
|
| 78 | 78 | }); |
| 79 | 79 | apply_filters( 'debug', 'Profiler Started' ); |
| 80 | 80 | apply_filters( 'debug', 'blackbar/profiler/noise' ); |
| 81 | - set_error_handler( array( $this, 'errorHandler' ), E_ALL|E_STRICT ); |
|
| 81 | + set_error_handler( array( $this, 'errorHandler' ), E_ALL | E_STRICT ); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function path( $file = '' ) |
| 89 | 89 | { |
| 90 | - return plugin_dir_path( $this->file ).ltrim( trim( $file ), '/' ); |
|
| 90 | + return plugin_dir_path( $this->file ) . ltrim( trim( $file ), '/' ); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function render( $view, array $data = array() ) |
| 98 | 98 | { |
| 99 | - $file = $this->path( sprintf( 'views/%s.php', str_replace( '.php', '', $view ))); |
|
| 100 | - if( !file_exists( $file ))return; |
|
| 99 | + $file = $this->path( sprintf( 'views/%s.php', str_replace( '.php', '', $view ) ) ); |
|
| 100 | + if( !file_exists( $file ) )return; |
|
| 101 | 101 | extract( $data ); |
| 102 | 102 | include $file; |
| 103 | 103 | } |
@@ -108,6 +108,6 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function url( $path = '' ) |
| 110 | 110 | { |
| 111 | - return esc_url( plugin_dir_url( $this->file ).ltrim( trim( $path ), '/' )); |
|
| 111 | + return esc_url( plugin_dir_url( $this->file ) . ltrim( trim( $path ), '/' ) ); |
|
| 112 | 112 | } |
| 113 | 113 | } |