PluginProbe
PhastPress / 1.93
PhastPress v1.93
3.12 3.11 1.75 1.76 1.77 1.78 1.79 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.90 1.91 1.92 1.93 1.94 1.95 1.96 1.97 All 119 releases
phastpress / classes / Compat / Log.php

Log.php in PhastPress 1.93, at classes/Compat/Log.php

33 lines 827 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Kibo\PhastPlugins\PhastPress\Compat;
3
4 class Log {
5 private static $messages;
6
7 public static function setup() {
8 add_action('wp_head', __CLASS__ . '::output');
9 }
10
11 public static function add($plugin, $message) {
12 self::$messages[$plugin][] = $message;
13 }
14
15 public static function output() {
16 if (empty(self::$messages)) {
17 return;
18 }
19
20 $o = '<script data-phast-no-defer>';
21 $o .= 'console.group("[PhastPress] Plugin compatibility");';
22 foreach (self::$messages as $plugin => $messages) {
23 foreach ($messages as $message) {
24 $o .= 'console.log(' . json_encode("{$plugin}: {$message}") . ');';
25 }
26 }
27 $o .= 'console.groupEnd();';
28 $o .= '</script>';
29
30 echo $o;
31 }
32 }
33