# phastpress/1.92/classes/Compat/Log.php

PhastPress, version 1.92. 33 lines.

- Page: https://pluginprobe.com/plugins/phastpress/1.92/code/classes/Compat/Log.php
- Raw: https://pluginprobe.com/plugins/phastpress/1.92/raw/classes/Compat/Log.php
- Modified: 2020-11-19T10:20:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/phastpress/1.92/code/classes/Compat/Log.php#L10-L20`.

```php
<?php
namespace Kibo\PhastPlugins\PhastPress\Compat;

class Log {
    private static $messages;

    public static function setup() {
        add_action('wp_head', __CLASS__ . '::output');
    }

    public static function add($plugin, $message) {
        self::$messages[$plugin][] = $message;
    }

    public static function output() {
        if (empty(self::$messages)) {
            return;
        }

        $o = '<script data-phast-no-defer>';
        $o .= 'console.group("[PhastPress] Plugin compatibility");';
        foreach (self::$messages as $plugin => $messages) {
            foreach ($messages as $message) {
                $o .= 'console.log(' . json_encode("{$plugin}: {$message}") . ');';
            }
        }
        $o .= 'console.groupEnd();';
        $o .= '</script>';

        echo $o;
    }
}

```
