Title: PHP Console Log
Author: Marcus Viar
Published: <strong>2019年7月10日</strong>
Last modified: 2020年2月7日

---

プラグインを検索

![](https://ps.w.org/php-console-log/assets/banner-772x250.png?rev=2121006)

このプラグインは **WordPress の最新3回のメジャーリリースに対してテストされていま
せん**。もうメンテナンスやサポートがされていないかもしれず、最新バージョンの WordPress
で使用した場合は互換性の問題が発生する可能性があります。

![](https://ps.w.org/php-console-log/assets/icon.svg?rev=2121006)

# PHP Console Log

 作者: [Marcus Viar](https://profiles.wordpress.org/marcusviar/)

[ダウンロード](https://downloads.wordpress.org/plugin/php-console-log.1.0.1.zip)

 * [詳細](https://ja.wordpress.org/plugins/php-console-log/#description)
 * [レビュー](https://ja.wordpress.org/plugins/php-console-log/#reviews)
 *  [インストール](https://ja.wordpress.org/plugins/php-console-log/#installation)
 * [開発](https://ja.wordpress.org/plugins/php-console-log/#developers)

 [サポート](https://wordpress.org/support/plugin/php-console-log/)

## 説明

#### Examples

Place the **do_action( ‘php_console_log’, ‘My String or Array’ );** function anywhere
in your WordPress plugin PHP code. The value(s) you pass into **do_action( ‘php_console_log’,‘
My String or Array’ );** will be logged to the web console in your browser.

#### Pass in a string

    ```
    $my_string = 'My String';
    do_action( 'php_console_log', $my_string );
    ```

#### Pass in an array

    ```
    $my_array = array(
        'elm 1'
        'elm 2',
    );
    do_action( 'php_console_log', $my_array );
    ```

#### Pass in an associative array

    ```
    $my_array = array(
        'key 1'=>'elm 1',
        'key 2'=>'elm 2',
    );
    do_action( 'php_console_log', $my_array);
    ```

#### Pass in an unlimited number of arguments nested to an unlimited depth (multi-dimensional array)

    ```
    $my_array = array(
        'My String 1',
        'My String 2',
        array(
            'elm 1',
            'elm 2',
        ),
        'My String 3',
        array(
            'key 1'=>'elm 1',
            'key 2'=>'elm 2',
            'key 3' => array(
                'key 3a' => 'elm 3a',
                'key 3b' => 'elm 3b',
            ),
        ),
        'My String 4'
    );
    do_action( 'php_console_log', $my_array);
    ```

## スクリーンショット

 * [[
 * If PHP Console Log is working and you have not called **do_action( ‘php_console_log’,‘
   My String or Array’ );** you will see a message similar to this in your browsers
   web console.

## インストール

 1. Upload the plugin files to the `/wp-content/plugins/php-console-log` directory,
    or install the plugin through the WordPress plugins screen directly.
 2. Activate the plugin through the ‘Plugins’ screen in WordPress.
 3. You can find the help page in Plugins->PHP Console Log->Help for usage instructions.

## FAQ

  How do I know PHP Console Log is working?

If PHP Console Log is working and you have not called **do_action( ‘php_console_log’,‘
My String or Array’ );** you will see a message similar to this in your browsers
web console:

> ———– PHP Console Log ———–
> Place the do_action( ‘php_console_log’, ‘My String or Array’ ); function anywhere
> in your WordPress plugin PHP code.
>  The value(s) you pass into do_action( ‘php_console_log’,‘
> My String or Array’ ); will be logged to the web console in your browser. See “
> Help” link found on plugins page in your WordPress Admin for more information.
> ———– PHP Console Log ———–

  Why is PHP Console Log not working?

The most common reasons that cause PHP Console Log to fail when logging your information
to the web console are:

 1. **Cause:**
     The PHP Console log plugin is not activated.
 2. **Solution:**
     Activate the PHP Console Log Plugin.
 3. **Cause:**
     Another plugin has changed the order in which your plugins load. Making
    the PHP Console Log functions not available yet.
 4. **Solution:**
     PHP Console Log updates the order in which plugins are loaded any
    time a plugin is activated or deactivated. However, it is still possible for other
    plugins to change the order in which plugins load afterwards. Deactivate any plugins
    that change the order in which your plugins load.
 5. **Cause:**
     do_action( ‘php_console_log’, ‘My String or Array’ ); was called inside
    a block of code that was not run.
 6. **Solution:**
     Make sure the function you called do_action( ‘php_console_log’, ‘
    My String or Array’ ); in is run via an action or filter hook such as: add_action(‘
    init’, ‘my_function’ ); Or call do_action( ‘php_console_log’, ‘My String or Array’);
    outside of any other functions in a file that you know is run.
 7. **Cause:**
     PHP throws errors. Side Note: Make sure you are using define( ‘WP_DEBUG’,
    true ); in your wp-config.php file so you can see PHP errors.
 8. **Solution:**
     Fix the error that PHP is showing you. Then try again.

  How do I open the web console in Chrome?

Press Command+Option+J (Mac) or Control+Shift+J (Windows, Linux, Chrome OS) to jump
straight into the Console panel.

source: (https://developers.google.com/web/tools/chrome-devtools/open#console)

  How do I open the web console in Firefox?

 * Select **Web Console** from the Web Developer submenu in the Firefox Menu (or
   Tools menu if you display the menu bar or are on Mac OS X).
 * **OR**
 * Press the Ctrl + Shift + K (Command + Option + K on OS X) keyboard shortcut.

source: (https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Opening_the_Web_Console)

  How do I open the web console in Safari?

Select **Develop menu** in the menu bar, choose **Show JavaScript Console**

If you don’t see the Develop menu in the menu bar, choose Safari > Preferences, 
click Advanced, then select “Show Develop menu in menu bar”.

source: (https://support.apple.com/guide/safari-developer/develop-menu-dev39df999c1/
mac)

## 評価

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

### 󠀁[Helpful Tool](https://wordpress.org/support/topic/helpful-tool-20/)󠁿

 [arakos](https://profiles.wordpress.org/arakos/) 2020年1月2日

Works with WordPress 5.3.2

 [ 1件のレビューをすべて表示 ](https://wordpress.org/support/plugin/php-console-log/reviews/)

## 貢献者と開発者

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

貢献者

 *   [ Marcus Viar ](https://profiles.wordpress.org/marcusviar/)

[“PHP Console Log” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/php-console-log)

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

[コードを閲覧](https://plugins.trac.wordpress.org/browser/php-console-log/)するか、
[SVN リポジトリ](https://plugins.svn.wordpress.org/php-console-log/)をチェックする
か、[開発ログ](https://plugins.trac.wordpress.org/log/php-console-log/)を [RSS](https://plugins.trac.wordpress.org/log/php-console-log/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## 変更履歴

#### 1.0.0

Initial release.

## メタ

 *  バージョン **1.0.1**
 *  最終更新日 **6年前**
 *  有効インストール数 **20+**
 *  WordPress バージョン ** 4.4またはそれ以降 **
 *  検証済み最新バージョン: **5.3.21**
 *  PHP バージョン ** 5.6.20またはそれ以降 **
 *  言語
 * [English (US)](https://wordpress.org/plugins/php-console-log/)
 * タグ
 * [browser](https://ja.wordpress.org/plugins/tags/browser/)[console.log](https://ja.wordpress.org/plugins/tags/console-log/)
   [debug](https://ja.wordpress.org/plugins/tags/debug/)[development](https://ja.wordpress.org/plugins/tags/development/)
   [php](https://ja.wordpress.org/plugins/tags/php/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/php-console-log/advanced/)

## 評価

 5つ星中5つ星

 *  [  1 5-星レビュー     ](https://wordpress.org/support/plugin/php-console-log/reviews/?filter=5)
 *  [  0 4-星レビュー     ](https://wordpress.org/support/plugin/php-console-log/reviews/?filter=4)
 *  [  0 3-星レビュー     ](https://wordpress.org/support/plugin/php-console-log/reviews/?filter=3)
 *  [  0 2-星レビュー     ](https://wordpress.org/support/plugin/php-console-log/reviews/?filter=2)
 *  [  0 1-星レビュー     ](https://wordpress.org/support/plugin/php-console-log/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/php-console-log/reviews/#new-post)

[すべてのレビューを見る](https://wordpress.org/support/plugin/php-console-log/reviews/)

## 貢献者

 *   [ Marcus Viar ](https://profiles.wordpress.org/marcusviar/)

## サポート

意見や質問がありますか ?

 [サポートフォーラムを表示](https://wordpress.org/support/plugin/php-console-log/)

## 寄付

このプラグインが今後も改善できるよう応援しませんか ?

 [ このプラグインに寄付 ](https://paypal.me/marcusviar)