Black Bar

説明

Black Bar is an unobtrusive Debug Bar for WordPress developers that attaches itself to the bottom of the browser window. It is a rewrite of blackbox-debug-bar by Grzegorz Winiarski which appears to be abandoned as it has not been updated since 2013.

How it helps you with development:

  • Displays any PHP errors that occur when loading a page
  • Displays executed MySQL queries and the time it took to execute each query
  • Displays the loaded template files of the active theme
  • Inspect global variables (COOKIE, GET, POST, SERVER, SESSION)
  • Use the Console for debugging your plugins and themes
  • Use the Profiler for measuring the performance of your plugins and themes

インストール

Automatic installation

Log in to your WordPress dashboard, navigate to the Plugins menu and click “Add New”.

In the search field type “Black Bar” and click Search Plugins. Once you have found the plugin you can view details about it such as the point release, rating and description. You can install it by simply clicking “Install Now”.

Manual installation

Download the Black Bar plugin and uploading it to your server via your favorite FTP application. The WordPress codex contains instructions on how to do this here.

FAQ

How do I add entries to the Console?

To add entries to the console, simply put the following line of PHP anywhere in your code:

apply_filters( 'console', 'Enter something to debug here' );

You can also add a specific log level like this:

apply_filters( 'console', 'Enter something to debug here', 'error' );

The available log levels are: debug, info, notice, warning, error, critical, alert, and emergency.

How do I use the Profiler?

To use the profiler, simply put the following line of PHP before and after the code you wish to profile:

apply_filters( 'profile', 'Enter a description of what you are profiling here' );
How do I restrict the plugin to logged-in administrators?

To restrict the plugin to logged-in administrators, use the following filter in your theme’s functions.php file:

/**
 * @return boolean
 */
add_filter( 'blackbar/enabled', function( $bool ) {
    $bool = is_user_logged_in()
        ? current_user_can( 'administrator' )
        : false;
    return $bool;
});

評価

2019年7月23日
Thank you for giving new life to BlackBox Debug Bar! Not only the usefulness of this plugin, but the beautiful PHP coding leads me to write this review. I have learnt a lot from your code.
2019年3月28日
This is a beautiful way to interpress the data, I am a developer and this plugin helped me correct errors, I really feel very inspired. Thanks for the idea.
2019年1月19日
This plugin can make life easier when a quick debug is needed. I use it specially to inspect what my $_GET, $_POST, $_SESSION, $_COOKIES variables look like.
5件のレビューをすべて表示

貢献者と開発者

Black Bar はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。

貢献者

“Black Bar” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。

変更履歴

2.2.1 (2019-03-11)

  • Fixed CSS styles

2.2.0 (2019-03-10)

  • Added ability to add a log level to the console (i.e. ‘debug’, ‘warning’, ‘error’, etc.)
  • Fixed CSS styles

2.1.4 (2019-02-15)

  • Fixed CSS styles

2.1.3 (2019-01-28)

  • Updated plugin URL

2.1.2 (2019-01-18)

  • Fixed javascript error when SAVEQUERIES is not enabled

2.1.1 (2018-12-26)

  • Fixed code highlighting

2.1.0 (2018-09-08)

  • Added a “blackbar/enabled” filter hook which returns true or false. This can be used in your theme’s functions.php file to restrict the blackbar from displaying for specific users (or non-logged-in users).

2.0.0 (2018-07-18)

  • Added a console tab (replaces the Errors tab, see the FAQ on how to use)
  • Fixed SQL execution time filter
  • Fixed miscellaneous styling issues
  • Press ESC to close the blackbar panel
  • Updated activation requirements check
  • Updated minimum requirements to PHP 5.6/WP 4.7

1.2.0 (2018-04-23)

  • Display loaded templates from the active theme
  • Fixed CSS styles

1.1.0 (2018-04-21)

  • Lowered PHP requirement to 5.4
  • Fixed CSS styles
  • Fixed plugin activation class
  • Fixed query logging

1.0.0 (2018-02-22)

  • Initial plugin release