@@ -1,3 +1,3 @@ |
||
| 1 | -<?php defined( 'WPINC' ) || die; |
|
| 1 | +<?php defined('WPINC') || die; |
|
| 2 | 2 | |
| 3 | 3 | Development::printTemplatePaths(); |
@@ -1,7 +1,7 @@ |
||
| 1 | -<?php defined( 'WPINC' ) || die; ?> |
|
| 1 | +<?php defined('WPINC') || die; ?> |
|
| 2 | 2 | |
| 3 | -<pre><code class="php">$_GET = <?= esc_html( var_export( $_GET, true )); ?>;</code></pre><br/> |
|
| 4 | -<pre><code class="php">$_POST = <?= esc_html( var_export( $_POST, true )); ?>;</code></pre><br/> |
|
| 5 | -<pre><code class="php">$_COOKIE = <?= esc_html( var_export( $_COOKIE, true )); ?>;</code></pre><br/> |
|
| 6 | -<pre><code class="php">$_SESSION = <?= esc_html( var_export( $_SESSION, true )); ?>;</code></pre><br/> |
|
| 7 | -<pre><code class="php">$_SERVER = <?= esc_html( var_export( $_SERVER, true )); ?>;</code></pre><br/> |
|
| 3 | +<pre><code class="php">$_GET = <?= esc_html(var_export($_GET, true)); ?>;</code></pre><br/> |
|
| 4 | +<pre><code class="php">$_POST = <?= esc_html(var_export($_POST, true)); ?>;</code></pre><br/> |
|
| 5 | +<pre><code class="php">$_COOKIE = <?= esc_html(var_export($_COOKIE, true)); ?>;</code></pre><br/> |
|
| 6 | +<pre><code class="php">$_SESSION = <?= esc_html(var_export($_SESSION, true)); ?>;</code></pre><br/> |
|
| 7 | +<pre><code class="php">$_SERVER = <?= esc_html(var_export($_SERVER, true)); ?>;</code></pre><br/> |
|
@@ -1,12 +1,12 @@ |
||
| 1 | -<?php defined( 'WPINC' ) || die; ?> |
|
| 1 | +<?php defined('WPINC') || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <table> |
| 4 | 4 | <tbody> |
| 5 | - <?php foreach( $profiler->getMeasure() as $timer ) : ?> |
|
| 5 | + <?php foreach ($profiler->getMeasure() as $timer) : ?> |
|
| 6 | 6 | <tr> |
| 7 | - <td><?= $profiler->getNameString( $timer ); ?></td> |
|
| 8 | - <td class="glbb-number"><?= $profiler->getTimeString( $timer ); ?></td> |
|
| 9 | - <td><?= $profiler->getMemoryString( $timer ); ?></td> |
|
| 7 | + <td><?= $profiler->getNameString($timer); ?></td> |
|
| 8 | + <td class="glbb-number"><?= $profiler->getTimeString($timer); ?></td> |
|
| 9 | + <td><?= $profiler->getMemoryString($timer); ?></td> |
|
| 10 | 10 | </tr> |
| 11 | 11 | <?php endforeach; ?> |
| 12 | 12 | </tbody> |
@@ -1,12 +1,12 @@ |
||
| 1 | -<?php defined( 'WPINC' ) || die; ?> |
|
| 1 | +<?php defined('WPINC') || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <form method="get" class="glbb-queries-filter"> |
| 4 | - <input type="text" name="glbb_query_filter" id="glbb_query_filter" placeholder="<?= __( 'Find queries containing', 'blackbar' ); ?>"> |
|
| 5 | - <input type="text" name="glbb_query_min_time" id="glbb_query_min_time" placeholder="<?= __( 'Minimum Execution Time', 'blackbar' ); ?>"> |
|
| 4 | + <input type="text" name="glbb_query_filter" id="glbb_query_filter" placeholder="<?= __('Find queries containing', 'blackbar'); ?>"> |
|
| 5 | + <input type="text" name="glbb_query_min_time" id="glbb_query_min_time" placeholder="<?= __('Minimum Execution Time', 'blackbar'); ?>"> |
|
| 6 | 6 | </form> |
| 7 | 7 | <table> |
| 8 | 8 | <tbody> |
| 9 | - <?php foreach( $queries as $query ) : ?> |
|
| 9 | + <?php foreach ($queries as $query) : ?> |
|
| 10 | 10 | <tr> |
| 11 | 11 | <td class="glbb-number"><?= $query['ms']; ?></td> |
| 12 | 12 | <td><pre><code class="sql"><?= $query['sql']; ?></code></pre></td> |
@@ -1,8 +1,8 @@ |
||
| 1 | -<?php defined( 'WPINC' ) || die; ?> |
|
| 1 | +<?php defined('WPINC') || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <table> |
| 4 | 4 | <tbody> |
| 5 | - <?php foreach( $errors as $error ) : ?> |
|
| 5 | + <?php foreach ($errors as $error) : ?> |
|
| 6 | 6 | <tr> |
| 7 | 7 | <td><?= $error['name']; ?></td> |
| 8 | 8 | <td><?= $error['message']; ?></td> |
@@ -1,32 +1,32 @@ |
||
| 1 | -<?php defined( 'WPINC' ) || die; |
|
| 2 | -$isCastorTheme = class_exists( '\GeminiLabs\Castor\Application' ); |
|
| 1 | +<?php defined('WPINC') || die; |
|
| 2 | +$isCastorTheme = class_exists('\GeminiLabs\Castor\Application'); |
|
| 3 | 3 | ?> |
| 4 | 4 | |
| 5 | 5 | <div id="glbb-debug-bar"> |
| 6 | - <a href="#" class="glbb-toggle glbb-off"><?= __( 'Toggle', 'blackbar' ); ?></a> |
|
| 7 | - <a href="javascript:Blackbar.switchPanel('glbb-globals')" class="glbb-globals"><?= __( 'Globals', 'blackbar' ); ?></a> |
|
| 6 | + <a href="#" class="glbb-toggle glbb-off"><?= __('Toggle', 'blackbar'); ?></a> |
|
| 7 | + <a href="javascript:Blackbar.switchPanel('glbb-globals')" class="glbb-globals"><?= __('Globals', 'blackbar'); ?></a> |
|
| 8 | 8 | <a href="javascript:Blackbar.switchPanel('glbb-profiler')" class="glbb-profiler"><?= $profilerLabel; ?></a> |
| 9 | 9 | <a href="javascript:Blackbar.switchPanel('glbb-queries')" class="glbb-queries"><?= $queriesLabel; ?></a> |
| 10 | - <?php if( $isCastorTheme ) : ?> |
|
| 11 | - <a href="javascript:Blackbar.switchPanel('glbb-templates')" class="glbb-templates"><?= __( 'Templates', 'blackbar' ); ?></a> |
|
| 10 | + <?php if ($isCastorTheme) : ?> |
|
| 11 | + <a href="javascript:Blackbar.switchPanel('glbb-templates')" class="glbb-templates"><?= __('Templates', 'blackbar'); ?></a> |
|
| 12 | 12 | <?php endif; ?> |
| 13 | 13 | <a href="javascript:Blackbar.switchPanel('glbb-errors')" class="glbb-errors"><?= $errorsLabel; ?></a> |
| 14 | - <a href="javascript:Blackbar.close()" class="glbb-close"><?= __( 'Close', 'blackbar' ); ?></a> |
|
| 14 | + <a href="javascript:Blackbar.close()" class="glbb-close"><?= __('Close', 'blackbar'); ?></a> |
|
| 15 | 15 | <div id="glbb-globals" class="glbb-debug-panel"> |
| 16 | - <?php $blackbar->render( 'panels/globals' ); ?> |
|
| 16 | + <?php $blackbar->render('panels/globals'); ?> |
|
| 17 | 17 | </div> |
| 18 | 18 | <div id="glbb-profiler" class="glbb-debug-panel"> |
| 19 | - <?php $blackbar->render( 'panels/profiler', array( 'profiler' => $profiler )); ?> |
|
| 19 | + <?php $blackbar->render('panels/profiler', array('profiler' => $profiler)); ?> |
|
| 20 | 20 | </div> |
| 21 | 21 | <div id="glbb-queries" class="glbb-debug-panel"> |
| 22 | - <?php $blackbar->render( 'panels/queries', array( 'queries' => $queries )); ?> |
|
| 22 | + <?php $blackbar->render('panels/queries', array('queries' => $queries)); ?> |
|
| 23 | 23 | </div> |
| 24 | - <?php if( $isCastorTheme ) : ?> |
|
| 24 | + <?php if ($isCastorTheme) : ?> |
|
| 25 | 25 | <div id="glbb-templates" class="glbb-debug-panel"> |
| 26 | - <?php $blackbar->render( 'panels/templates' ); ?> |
|
| 26 | + <?php $blackbar->render('panels/templates'); ?> |
|
| 27 | 27 | </div> |
| 28 | 28 | <?php endif; ?> |
| 29 | 29 | <div id="glbb-errors" class="glbb-debug-panel"> |
| 30 | - <?php $blackbar->render( 'panels/errors', array( 'errors' => $errors )); ?> |
|
| 30 | + <?php $blackbar->render('panels/errors', array('errors' => $errors)); ?> |
|
| 31 | 31 | </div> |
| 32 | 32 | </div> |
@@ -1,21 +1,21 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -defined( 'WPINC' ) || die; |
|
| 3 | +defined('WPINC') || die; |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * PSR-4 autoloader |
| 7 | 7 | */ |
| 8 | -spl_autoload_register( function( $class ) |
|
| 8 | +spl_autoload_register(function($class) |
|
| 9 | 9 | { |
| 10 | 10 | $namespaces = [ |
| 11 | 11 | 'GeminiLabs\\Blackbar\\' => __DIR__.'/src/', |
| 12 | 12 | 'GeminiLabs\\Blackbar\\Tests\\' => __DIR__.'/tests/', |
| 13 | 13 | ]; |
| 14 | - foreach( $namespaces as $prefix => $base_dir ) { |
|
| 15 | - $len = strlen( $prefix ); |
|
| 16 | - if( strncmp( $prefix, $class, $len ) !== 0 )continue; |
|
| 17 | - $file = $base_dir . str_replace( '\\', '/', substr( $class, $len )).'.php'; |
|
| 18 | - if( !file_exists( $file ))continue; |
|
| 14 | + foreach ($namespaces as $prefix => $base_dir) { |
|
| 15 | + $len = strlen($prefix); |
|
| 16 | + if (strncmp($prefix, $class, $len) !== 0)continue; |
|
| 17 | + $file = $base_dir.str_replace('\\', '/', substr($class, $len)).'.php'; |
|
| 18 | + if (!file_exists($file))continue; |
|
| 19 | 19 | require $file; |
| 20 | 20 | break; |
| 21 | 21 | } |
@@ -16,10 +16,10 @@ |
||
| 16 | 16 | * Domain Path: languages |
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | -defined( 'WPINC' ) || die; |
|
| 19 | +defined('WPINC') || die; |
|
| 20 | 20 | |
| 21 | 21 | require_once __DIR__.'/activate.php'; |
| 22 | -if( \GL_BlackBar_Activate::shouldDeactivate() )return; |
|
| 22 | +if (\GL_BlackBar_Activate::shouldDeactivate())return; |
|
| 23 | 23 | |
| 24 | 24 | require_once __DIR__.'/autoload.php'; |
| 25 | 25 | (new \GeminiLabs\Blackbar\Application)->init(); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -defined( 'WPINC' ) || die; |
|
| 3 | +defined('WPINC') || die; |
|
| 4 | 4 | |
| 5 | 5 | class GL_BlackBar_Activate |
| 6 | 6 | { |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public static function isPhpValid() |
| 28 | 28 | { |
| 29 | - return !version_compare( PHP_VERSION, static::MIN_PHP_VERSION, '<' ); |
|
| 29 | + return !version_compare(PHP_VERSION, static::MIN_PHP_VERSION, '<'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public static function isWpValid() |
| 36 | 36 | { |
| 37 | 37 | global $wp_version; |
| 38 | - return !version_compare( $wp_version, static::MIN_WORDPRESS_VERSION, '<' ); |
|
| 38 | + return !version_compare($wp_version, static::MIN_WORDPRESS_VERSION, '<'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -43,12 +43,12 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public static function shouldDeactivate() |
| 45 | 45 | { |
| 46 | - if( empty( static::$instance )) { |
|
| 46 | + if (empty(static::$instance)) { |
|
| 47 | 47 | static::$instance = new static; |
| 48 | 48 | } |
| 49 | - if( !static::isValid() ) { |
|
| 50 | - add_action( 'activated_plugin', array( static::$instance, 'deactivate' )); |
|
| 51 | - add_action( 'admin_notices', array( static::$instance, 'deactivate' )); |
|
| 49 | + if (!static::isValid()) { |
|
| 50 | + add_action('activated_plugin', array(static::$instance, 'deactivate')); |
|
| 51 | + add_action('admin_notices', array(static::$instance, 'deactivate')); |
|
| 52 | 52 | return true; |
| 53 | 53 | } |
| 54 | 54 | return false; |
@@ -57,14 +57,14 @@ discard block |
||
| 57 | 57 | /** |
| 58 | 58 | * @return void |
| 59 | 59 | */ |
| 60 | - public function deactivate( $plugin ) |
|
| 60 | + public function deactivate($plugin) |
|
| 61 | 61 | { |
| 62 | - if( static::isValid() )return; |
|
| 63 | - $pluginName = plugin_basename( dirname( realpath( __FILE__ )).'/'.static::BASENAME ); |
|
| 64 | - if( $plugin == $pluginName ) { |
|
| 62 | + if (static::isValid())return; |
|
| 63 | + $pluginName = plugin_basename(dirname(realpath(__FILE__)).'/'.static::BASENAME); |
|
| 64 | + if ($plugin == $pluginName) { |
|
| 65 | 65 | $this->redirect(); //exit |
| 66 | 66 | } |
| 67 | - deactivate_plugins( $pluginName ); |
|
| 67 | + deactivate_plugins($pluginName); |
|
| 68 | 68 | $this->printNotice(); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -73,10 +73,10 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | protected function redirect() |
| 75 | 75 | { |
| 76 | - wp_safe_redirect( self_admin_url( sprintf( 'plugins.php?plugin_status=%s&paged=%s&s=%s', |
|
| 77 | - filter_input( INPUT_GET, 'plugin_status' ), |
|
| 78 | - filter_input( INPUT_GET, 'paged' ), |
|
| 79 | - filter_input( INPUT_GET, 's' ) |
|
| 76 | + wp_safe_redirect(self_admin_url(sprintf('plugins.php?plugin_status=%s&paged=%s&s=%s', |
|
| 77 | + filter_input(INPUT_GET, 'plugin_status'), |
|
| 78 | + filter_input(INPUT_GET, 'paged'), |
|
| 79 | + filter_input(INPUT_GET, 's') |
|
| 80 | 80 | ))); |
| 81 | 81 | exit; |
| 82 | 82 | } |
@@ -88,25 +88,25 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | $noticeTemplate = '<div id="message" class="notice notice-error error is-dismissible"><p><strong>%s</strong></p><p>%s</p><p>%s</p></div>'; |
| 90 | 90 | $messages = array( |
| 91 | - __( 'The Black Bar plugin was deactivated.', 'blackbar' ), |
|
| 92 | - __( 'Sorry, this plugin requires %s or greater in order to work properly.', 'blackbar' ), |
|
| 93 | - __( 'Please contact your hosting provider or server administrator to upgrade the version of PHP on your server (your server is running PHP version %s), or try to find an alternative plugin.', 'blackbar' ), |
|
| 94 | - __( 'PHP version', 'blackbar' ).' '.static::MIN_PHP_VERSION, |
|
| 95 | - __( 'WordPress version', 'blackbar' ).' '.static::MIN_WORDPRESS_VERSION, |
|
| 96 | - __( 'Update WordPress', 'blackbar' ), |
|
| 91 | + __('The Black Bar plugin was deactivated.', 'blackbar'), |
|
| 92 | + __('Sorry, this plugin requires %s or greater in order to work properly.', 'blackbar'), |
|
| 93 | + __('Please contact your hosting provider or server administrator to upgrade the version of PHP on your server (your server is running PHP version %s), or try to find an alternative plugin.', 'blackbar'), |
|
| 94 | + __('PHP version', 'blackbar').' '.static::MIN_PHP_VERSION, |
|
| 95 | + __('WordPress version', 'blackbar').' '.static::MIN_WORDPRESS_VERSION, |
|
| 96 | + __('Update WordPress', 'blackbar'), |
|
| 97 | 97 | ); |
| 98 | - if( !static::isPhpValid() ) { |
|
| 99 | - printf( $noticeTemplate, |
|
| 98 | + if (!static::isPhpValid()) { |
|
| 99 | + printf($noticeTemplate, |
|
| 100 | 100 | $messages[0], |
| 101 | - sprintf( $messages[1], $messages[3] ), |
|
| 102 | - sprintf( $messages[2], PHP_VERSION ) |
|
| 101 | + sprintf($messages[1], $messages[3]), |
|
| 102 | + sprintf($messages[2], PHP_VERSION) |
|
| 103 | 103 | ); |
| 104 | 104 | } |
| 105 | - else if( !static::isWpValid() ) { |
|
| 106 | - printf( $noticeTemplate, |
|
| 105 | + else if (!static::isWpValid()) { |
|
| 106 | + printf($noticeTemplate, |
|
| 107 | 107 | $messages[0], |
| 108 | - sprintf( $messages[1], $messages[4] ), |
|
| 109 | - sprintf( '<a href="%s">%s</a>', admin_url( 'update-core.php' ), $messages[5] ) |
|
| 108 | + sprintf($messages[1], $messages[4]), |
|
| 109 | + sprintf('<a href="%s">%s</a>', admin_url('update-core.php'), $messages[5]) |
|
| 110 | 110 | ); |
| 111 | 111 | } |
| 112 | 112 | } |