Title: KL Debug
Author: Kiwik
Published: <strong>2020 年 2 月 25 日</strong>
Last modified: 2022 年 6 月 24 日

---

搜尋外掛

![](https://ps.w.org/kl-debug/assets/banner-772x250.png?rev=2249773)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://ps.w.org/kl-debug/assets/icon.svg?rev=2249773)

# KL Debug

 由 [Kiwik](https://profiles.wordpress.org/krealab/) 開發

[下載](https://downloads.wordpress.org/plugin/kl-debug.1.0.5.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/kl-debug/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/kl-debug/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/kl-debug/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/kl-debug/#developers)

 [技術支援](https://wordpress.org/support/plugin/kl-debug/)

## 外掛說明

Add a Debug Bar to your WordPress website to debug and develop your themes, plugins,
etc…

With the plugin you can find every variables you want to debug in the same place
and use debug functions to display them.

#### Prerequisites

To fully help you to debug your website you need to add some code to your `wp-config.
php` file.

    ```
    define( 'WP_DEBUG', true ); // PHP errors, notices and warnings will be displayed
    define( 'SAVEQUERIES', true ); // Display queries in current page
    define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true ); // Disable WP Fatal error handler
    ```

#### Usage of the debug functions

To debug a simple variable you can use:

    ```
    <?php dump( $var ); // Dump the variable(s) ?>
    ```

To debug a variable and stop the process after you can use:

    ```
    <?php dd( $var ); // This will die after dumping the variable(s) ?>
    ```

#### Debug a variable in the debug bar

This is one of the main aspect of the plugin, to debug variables in a separate place.

The most difficult task when you debug a variable is to deal with container width,
with the plugin you have a debug bar where you can add the variables of the current
page.

To add a variable to the debug bar you can use the function bellow:

    ```
    <?php kl_debug_add_var( $var ); ?>
    ```

You can add custom tabs in the debug bar to filter you variables:

    ```
    <?php
    kl_debug_add_var(
        $var, // The variable you want to debug
        'Your variable title', // If you want to name the variable
        'The section title', // The tab title
        'the-section-slug' // The tab slug
    );
    ?>
    ```

#### What’s Whoops in the setting panel?

Whoops is the framework that we use to display error handling. (cf. Pretty error
handler with stack frames)

## 螢幕擷圖

[⌊Debug bar open⌉⌊Debug bar open⌉[

Debug bar open

[⌊Settings interface⌉⌊Settings interface⌉[

Settings interface

[⌊Pretty error handler with stack frames(powered by Whoops)⌉⌊Pretty error handler
with stack frames(powered by Whoops)⌉[

Pretty error handler with stack frames(powered by Whoops)

## 安裝方式

#### Requirements

This plugin requires at least PHP 7.2.

#### How to install the plugin

 1. Upload the plugin files to the `/wp-content/plugins/kl-debug` directory, or install
    the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the \’Plugins\’ screen in WordPress
 3. Use the Tools->KL Debug screen to configure the plugin

## 常見問題集

### How to set which PHP errors are reported?

Simply add `error_reporting(E_ALL & ~E_NOTICE);` to the top of your theme functions.
php file. This will only display errors that are not notices.

### How can I deactivate the plugin if I can’t access the admin screen ?

Go to your FTP explorer and navigate to the plugin: wp-content>plugins. Rename the
folder by adding an _ in the beginning of the folder name.

## 使用者評論

![](https://secure.gravatar.com/avatar/c5e212b781b8d20f7b4dcded85777aed077382370d2f9b4faf1e32a127c17d49?
s=60&d=retro&r=g)

### 󠀁[Very helpful plugin](https://wordpress.org/support/topic/very-helpful-plugin-242/)󠁿

 [neverdev](https://profiles.wordpress.org/neverdev/) 2020 年 3 月 6 日

Nice toolbar !

 [ 閱讀全部 1 則使用者評論 ](https://wordpress.org/support/plugin/kl-debug/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈KL Debug〉的開發相關工作。

參與者

 *   [ Kiwik ](https://profiles.wordpress.org/krealab/)

〈KL Debug〉外掛目前已有 1 個本地化語言版本。 感謝[全部譯者](https://translate.wordpress.org/projects/wp-plugins/kl-debug/contributors)
為這個外掛做出的貢獻。

[將〈KL Debug〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/kl-debug)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/kl-debug/)、查看
[SVN 存放庫](https://plugins.svn.wordpress.org/kl-debug/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/kl-debug/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/kl-debug/)。

## 變更記錄

#### 1.0.5

 * [Added] Tested up to WordPress 6.0
 * [Updated] Composer dependencies

#### 1.0.4

 * [Added] Tested up to WordPress 5.8.2

#### 1.0.3

 * [Added] Tested up to WordPress 5.7.2

#### 1.0.2

 * [Added] Optimize autoload.php
 * [Fixed] autoload.php require path that can cause error 500

#### 1.0.1

 * [Fixed] jQuery error when plugin installed on WordPress 5.5

#### 1.0

 * [Added] Initial release

## 中繼資料

 *  版本 **1.0.5**
 *  最後更新 **4 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 5.2 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.0.16**
 *  PHP 版本需求 ** 7.2 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/kl-debug/) 及 [French (France)](https://fr.wordpress.org/plugins/kl-debug/).
 *  [將這個外掛本地化為你的母語版本](https://translate.wordpress.org/projects/wp-plugins/kl-debug)
 * 標籤:
 * [debug](https://tw.wordpress.org/plugins/tags/debug/)[developer](https://tw.wordpress.org/plugins/tags/developer/)
   [toolbar](https://tw.wordpress.org/plugins/tags/toolbar/)
 *  [進階檢視](https://tw.wordpress.org/plugins/kl-debug/advanced/)

## 評分

 5 星，滿分為 5 星

 *  [  1 個 5 星使用者評論     ](https://wordpress.org/support/plugin/kl-debug/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/kl-debug/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/kl-debug/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/kl-debug/reviews/?filter=2)
 *  [  0 個 1 星使用者評論     ](https://wordpress.org/support/plugin/kl-debug/reviews/?filter=1)

[撰寫評分](https://wordpress.org/support/plugin/kl-debug/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/kl-debug/reviews/)

## 參與者

 *   [ Kiwik ](https://profiles.wordpress.org/krealab/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/kl-debug/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://www.krealab.fr/)