Passed
Push — master ( 630338...867876 )
by Paul
03:16
created
views/panels/console.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,10 +6,13 @@
 block discarded – undo
6 6
 		<tr>
7 7
 			<td><?= __('No entries found.', 'blackbar'); ?></td>
8 8
 		</tr>
9
-		<?php else : ?>
9
+		<?php else {
10
+	: ?>
10 11
 		<?php foreach ($entries as $entry) : ?>
11 12
 		<tr>
12
-			<td class="glbb-small"><?= $entry['name']; ?></td>
13
+			<td class="glbb-small"><?= $entry['name'];
14
+}
15
+?></td>
13 16
 			<td><pre><?= $entry['message']; ?></pre></td>
14 17
 		</tr>
15 18
 		<?php endforeach; ?>
Please login to merge, or discard this patch.
views/panels/actions.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,14 +6,17 @@
 block discarded – undo
6 6
 		<tr>
7 7
 			<td><?= __('No entries found.', 'blackbar'); ?></td>
8 8
 		</tr>
9
-		<?php else : ?>
9
+		<?php else {
10
+	: ?>
10 11
 		<?php foreach ($actions->getMeasure() as $hook => $flow) : ?>
11 12
 		<tr>
12 13
 			<td class="glbb-smalls"><?php 
13 14
 			// glsr_log($flow); 
14 15
 			?></td>
15 16
 		</tr>
16
-		<?php endforeach; ?>
17
+		<?php endforeach;
18
+}
19
+?>
17 20
 		<?php endif; ?>
18 21
 	</tbody>
19 22
 </table>
Please login to merge, or discard this patch.
views/panels/queries.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,9 +8,12 @@
 block discarded – undo
8 8
 		</tr>
9 9
 	</tbody>
10 10
 </table>
11
-<?php else : ?>
11
+<?php else {
12
+	: ?>
12 13
 <form method="get" class="glbb-queries-filter">
13
-	<input type="text" name="glbb_query_filter" id="glbb_query_filter" placeholder="<?= __('Find queries containing', 'blackbar'); ?>">
14
+	<input type="text" name="glbb_query_filter" id="glbb_query_filter" placeholder="<?= __('Find queries containing', 'blackbar');
15
+}
16
+?>">
14 17
 	<input type="text" name="glbb_query_min_time" id="glbb_query_min_time" placeholder="<?= __('Minimum Execution Time', 'blackbar'); ?>">
15 18
 </form>
16 19
 <table class="glbb-queries-table">
Please login to merge, or discard this patch.
views/panels/profiler.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,10 +6,13 @@
 block discarded – undo
6 6
 		<tr>
7 7
 			<td><?= __('No entries found.', 'blackbar'); ?></td>
8 8
 		</tr>
9
-		<?php else : ?>
9
+		<?php else {
10
+	: ?>
10 11
 		<?php foreach ($profiler->getMeasure() as $timer) : ?>
11 12
 		<tr>
12
-			<td><?= $profiler->getNameString($timer); ?></td>
13
+			<td><?= $profiler->getNameString($timer);
14
+}
15
+?></td>
13 16
 			<td class="glbb-medium"><?= $profiler->getTimeString($timer); ?></td>
14 17
 			<td class="glbb-medium"><?= $profiler->getMemoryString($timer); ?></td>
15 18
 		</tr>
Please login to merge, or discard this patch.
compatibility.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
  * @see https://docs.gravityforms.com/gform_noconflict_scripts/
8 8
  */
9 9
 add_filter('gform_noconflict_scripts', function (array $scripts) {
10
-    $scripts[] = 'blackbar';
11
-    return $scripts;
10
+	$scripts[] = 'blackbar';
11
+	return $scripts;
12 12
 });
13 13
 
14 14
 /*
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @see https://docs.gravityforms.com/gform_noconflict_styles/
17 17
  */
18 18
 add_filter('gform_noconflict_styles', function (array $styles) {
19
-    $styles[] = 'blackbar';
20
-    $styles[] = 'blackbar-syntax';
21
-    return $styles;
19
+	$styles[] = 'blackbar';
20
+	$styles[] = 'blackbar-syntax';
21
+	return $styles;
22 22
 });
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,8 @@  discard block
 block discarded – undo
6 6
  * @return array
7 7
  * @see https://docs.gravityforms.com/gform_noconflict_scripts/
8 8
  */
9
-add_filter('gform_noconflict_scripts', function (array $scripts) {
9
+add_filter('gform_noconflict_scripts', function (array $scripts)
10
+{
10 11
     $scripts[] = 'blackbar';
11 12
     return $scripts;
12 13
 });
@@ -15,7 +16,8 @@  discard block
 block discarded – undo
15 16
  * @return array
16 17
  * @see https://docs.gravityforms.com/gform_noconflict_styles/
17 18
  */
18
-add_filter('gform_noconflict_styles', function (array $styles) {
19
+add_filter('gform_noconflict_styles', function (array $styles)
20
+{
19 21
     $styles[] = 'blackbar';
20 22
     $styles[] = 'blackbar-syntax';
21 23
     return $styles;
Please login to merge, or discard this patch.
autoload.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -3,20 +3,20 @@
 block discarded – undo
3 3
 defined('WPINC') || die;
4 4
 
5 5
 spl_autoload_register(function ($className) {
6
-    $namespaces = [
7
-        'GeminiLabs\\BlackBar\\' => __DIR__.'/plugin/',
8
-        'GeminiLabs\\BlackBar\\Tests\\' => __DIR__.'/tests/',
9
-    ];
10
-    foreach ($namespaces as $prefix => $baseDir) {
11
-        $len = strlen($prefix);
12
-        if (0 !== strncmp($prefix, $className, $len)) {
13
-            continue;
14
-        }
15
-        $file = $baseDir.str_replace('\\', '/', substr($className, $len)).'.php';
16
-        if (!file_exists($file)) {
17
-            continue;
18
-        }
19
-        require $file;
20
-        break;
21
-    }
6
+	$namespaces = [
7
+		'GeminiLabs\\BlackBar\\' => __DIR__.'/plugin/',
8
+		'GeminiLabs\\BlackBar\\Tests\\' => __DIR__.'/tests/',
9
+	];
10
+	foreach ($namespaces as $prefix => $baseDir) {
11
+		$len = strlen($prefix);
12
+		if (0 !== strncmp($prefix, $className, $len)) {
13
+			continue;
14
+		}
15
+		$file = $baseDir.str_replace('\\', '/', substr($className, $len)).'.php';
16
+		if (!file_exists($file)) {
17
+			continue;
18
+		}
19
+		require $file;
20
+		break;
21
+	}
22 22
 });
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,8 @@
 block discarded – undo
2 2
 
3 3
 defined('WPINC') || die;
4 4
 
5
-spl_autoload_register(function ($className) {
5
+spl_autoload_register(function ($className)
6
+{
6 7
     $namespaces = [
7 8
         'GeminiLabs\\BlackBar\\' => __DIR__.'/plugin/',
8 9
         'GeminiLabs\\BlackBar\\Tests\\' => __DIR__.'/tests/',
Please login to merge, or discard this patch.
plugin/SlowActions.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,9 +74,11 @@
 block discarded – undo
74 74
                         $object = get_class($object);
75 75
                     }
76 76
                     $this->flow[$action]['callbacks'][$priority][] = sprintf('%s::%s', $object, $method);
77
-                } elseif (is_object($callback['function'])) {
77
+                }
78
+                elseif (is_object($callback['function'])) {
78 79
                     $this->flow[$action]['callbacks'][$priority][] = get_class($callback['function']);
79
-                } else {
80
+                }
81
+                else {
80 82
                     $this->flow[$action]['callbacks'][$priority][] = $callback['function'];
81 83
                 }
82 84
                 ++$this->flow[$action]['callbacks_count'];
Please login to merge, or discard this patch.
Indentation   +136 added lines, -136 removed lines patch added patch discarded remove patch
@@ -4,140 +4,140 @@
 block discarded – undo
4 4
 
5 5
 class SlowActions
6 6
 {
7
-    /**
8
-     * @var array
9
-     */
10
-    protected $flow;
11
-
12
-    /**
13
-     * This is the time that WordPress takes to execute the all hook.
14
-     * @var int
15
-     */
16
-    protected $noise = 0;
17
-
18
-    /**
19
-     * @var int
20
-     */
21
-    protected $start = null;
22
-
23
-    /**
24
-     * @var int
25
-     */
26
-    protected $stop = null;
27
-
28
-    /**
29
-     * @var int
30
-     */
31
-    protected $totalActions = 0;
32
-
33
-    /**
34
-     * @var int
35
-     */
36
-    protected $totalTime = 0;
37
-
38
-    public function __construct()
39
-    {
40
-        $this->flow = [];
41
-        $this->start = microtime(true);
42
-    }
43
-
44
-    public function getTotalTimeForHook(array $data): array
45
-    {
46
-        $total = 0;
47
-        foreach ($data['time'] as $time) {
48
-            $total += ($time['stop'] - $time['start']) * 1000;
49
-        }
50
-        return $total;
51
-    }
52
-
53
-    public function addCallbacksForAction(string $action): array
54
-    {
55
-        global $wp_filter;
56
-        if (!array_key_exists($action, $this->flow)) {
57
-            return;
58
-        }
59
-        $this->flow[$action]['callbacks_count'] = 0;
60
-        foreach ($wp_filter[$action] as $priority => $callbacks) {
61
-            if (!array_key_exists($priority, $this->flow[$action]['callbacks'])) {
62
-                $this->flow[$action]['callbacks'][$priority] = [];
63
-            }
64
-            foreach ($callbacks as $callback) {
65
-                if (is_array($callback['function']) && 2 == count($callback['function'])) {
66
-                    list($object, $method) = $callback['function'];
67
-                    if (is_object($object)) {
68
-                        $object = get_class($object);
69
-                    }
70
-                    $this->flow[$action]['callbacks'][$priority][] = sprintf('%s::%s', $object, $method);
71
-                } elseif (is_object($callback['function'])) {
72
-                    $this->flow[$action]['callbacks'][$priority][] = get_class($callback['function']);
73
-                } else {
74
-                    $this->flow[$action]['callbacks'][$priority][] = $callback['function'];
75
-                }
76
-                ++$this->flow[$action]['callbacks_count'];
77
-            }
78
-        }
79
-    }
80
-
81
-    public function getMeasure(): array
82
-    {
83
-        foreach ($this->flow as $action => $data) {
84
-            $total = $this->getTotalTimeForHook($data);
85
-            $this->flow[$action]['total'] = $total;
86
-            $this->totalTime += $total;
87
-            $this->totalActions += $data['count'];
88
-            $this->addCallbacksForAction($action);
89
-        }
90
-        uasort($this->flow, [$this, 'sortByTime']);
91
-        return $this->flow;
92
-    }
93
-
94
-    public function getTotalActions(): int
95
-    {
96
-        return $this->totalActions;
97
-    }
98
-
99
-    /**
100
-     * Time in Microseconds
101
-     */
102
-    public function getTotalTime(): int
103
-    {
104
-        return $this->totalTime;
105
-        // $totalNoise = (count($this->timers) - 1) * $this->noise;
106
-        // return $this->stop - $this->start - $totalNoise;
107
-    }
108
-
109
-    public function startTimer(): void
110
-    {
111
-        if (!isset($this->flow[current_filter()])) {
112
-            $this->flow[current_filter()] = [
113
-                'callbacks' => [],
114
-                'count' => 0,
115
-                'stack' => [],
116
-                'time' => [],
117
-            ];
118
-            add_action(current_filter(), [$this, 'stopTimer'], 9000);
119
-        }
120
-        $count = ++$this->flow[current_filter()]['count'];
121
-        array_push($this->flow[current_filter()]['stack'], ['start' => microtime(true)]);
122
-    }
123
-
124
-    /**
125
-     * @param mixed $possibleFilter
126
-     * @return mixed
127
-     */
128
-    public function stopTimer($possibleFilter = null)
129
-    {
130
-        $time = array_pop($this->flow[current_filter()]['stack']);
131
-        $time['stop'] = microtime(true);
132
-        array_push($this->flow[current_filter()]['time'], $time);
133
-        return $possibleFilter;
134
-    }
135
-
136
-    protected function sortByTime(array $a, array $b): int
137
-    {
138
-        if ($a['total'] == $b['total']) {
139
-            return 0;
140
-        }
141
-        return ($a['total'] > $b['total']) ? -1 : 1;
142
-    }
7
+	/**
8
+	 * @var array
9
+	 */
10
+	protected $flow;
11
+
12
+	/**
13
+	 * This is the time that WordPress takes to execute the all hook.
14
+	 * @var int
15
+	 */
16
+	protected $noise = 0;
17
+
18
+	/**
19
+	 * @var int
20
+	 */
21
+	protected $start = null;
22
+
23
+	/**
24
+	 * @var int
25
+	 */
26
+	protected $stop = null;
27
+
28
+	/**
29
+	 * @var int
30
+	 */
31
+	protected $totalActions = 0;
32
+
33
+	/**
34
+	 * @var int
35
+	 */
36
+	protected $totalTime = 0;
37
+
38
+	public function __construct()
39
+	{
40
+		$this->flow = [];
41
+		$this->start = microtime(true);
42
+	}
43
+
44
+	public function getTotalTimeForHook(array $data): array
45
+	{
46
+		$total = 0;
47
+		foreach ($data['time'] as $time) {
48
+			$total += ($time['stop'] - $time['start']) * 1000;
49
+		}
50
+		return $total;
51
+	}
52
+
53
+	public function addCallbacksForAction(string $action): array
54
+	{
55
+		global $wp_filter;
56
+		if (!array_key_exists($action, $this->flow)) {
57
+			return;
58
+		}
59
+		$this->flow[$action]['callbacks_count'] = 0;
60
+		foreach ($wp_filter[$action] as $priority => $callbacks) {
61
+			if (!array_key_exists($priority, $this->flow[$action]['callbacks'])) {
62
+				$this->flow[$action]['callbacks'][$priority] = [];
63
+			}
64
+			foreach ($callbacks as $callback) {
65
+				if (is_array($callback['function']) && 2 == count($callback['function'])) {
66
+					list($object, $method) = $callback['function'];
67
+					if (is_object($object)) {
68
+						$object = get_class($object);
69
+					}
70
+					$this->flow[$action]['callbacks'][$priority][] = sprintf('%s::%s', $object, $method);
71
+				} elseif (is_object($callback['function'])) {
72
+					$this->flow[$action]['callbacks'][$priority][] = get_class($callback['function']);
73
+				} else {
74
+					$this->flow[$action]['callbacks'][$priority][] = $callback['function'];
75
+				}
76
+				++$this->flow[$action]['callbacks_count'];
77
+			}
78
+		}
79
+	}
80
+
81
+	public function getMeasure(): array
82
+	{
83
+		foreach ($this->flow as $action => $data) {
84
+			$total = $this->getTotalTimeForHook($data);
85
+			$this->flow[$action]['total'] = $total;
86
+			$this->totalTime += $total;
87
+			$this->totalActions += $data['count'];
88
+			$this->addCallbacksForAction($action);
89
+		}
90
+		uasort($this->flow, [$this, 'sortByTime']);
91
+		return $this->flow;
92
+	}
93
+
94
+	public function getTotalActions(): int
95
+	{
96
+		return $this->totalActions;
97
+	}
98
+
99
+	/**
100
+	 * Time in Microseconds
101
+	 */
102
+	public function getTotalTime(): int
103
+	{
104
+		return $this->totalTime;
105
+		// $totalNoise = (count($this->timers) - 1) * $this->noise;
106
+		// return $this->stop - $this->start - $totalNoise;
107
+	}
108
+
109
+	public function startTimer(): void
110
+	{
111
+		if (!isset($this->flow[current_filter()])) {
112
+			$this->flow[current_filter()] = [
113
+				'callbacks' => [],
114
+				'count' => 0,
115
+				'stack' => [],
116
+				'time' => [],
117
+			];
118
+			add_action(current_filter(), [$this, 'stopTimer'], 9000);
119
+		}
120
+		$count = ++$this->flow[current_filter()]['count'];
121
+		array_push($this->flow[current_filter()]['stack'], ['start' => microtime(true)]);
122
+	}
123
+
124
+	/**
125
+	 * @param mixed $possibleFilter
126
+	 * @return mixed
127
+	 */
128
+	public function stopTimer($possibleFilter = null)
129
+	{
130
+		$time = array_pop($this->flow[current_filter()]['stack']);
131
+		$time['stop'] = microtime(true);
132
+		array_push($this->flow[current_filter()]['time'], $time);
133
+		return $possibleFilter;
134
+	}
135
+
136
+	protected function sortByTime(array $a, array $b): int
137
+	{
138
+		if ($a['total'] == $b['total']) {
139
+			return 0;
140
+		}
141
+		return ($a['total'] > $b['total']) ? -1 : 1;
142
+	}
143 143
 }
Please login to merge, or discard this patch.
activate.php 2 patches
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -8,141 +8,141 @@
 block discarded – undo
8 8
  */
9 9
 class GL_Plugin_Check_v6
10 10
 {
11
-    const MIN_PHP_VERSION = '7.2';
12
-    const MIN_WORDPRESS_VERSION = '5.8';
11
+	const MIN_PHP_VERSION = '7.2';
12
+	const MIN_WORDPRESS_VERSION = '5.8';
13 13
 
14
-    /**
15
-     * @var array
16
-     */
17
-    public $versions;
14
+	/**
15
+	 * @var array
16
+	 */
17
+	public $versions;
18 18
 
19
-    /**
20
-     * @var string
21
-     */
22
-    protected $file;
19
+	/**
20
+	 * @var string
21
+	 */
22
+	protected $file;
23 23
 
24
-    /**
25
-     * @param string $file
26
-     */
27
-    public function __construct($file)
28
-    {
29
-        $this->file = realpath($file);
30
-        $versionRequirements = get_file_data($this->file, [
31
-            'php' => 'Requires PHP',
32
-            'wordpress' => 'Requires at least',
33
-        ]);
34
-        $this->versions = wp_parse_args(array_filter($versionRequirements), [
35
-            'php' => static::MIN_PHP_VERSION,
36
-            'wordpress' => static::MIN_WORDPRESS_VERSION,
37
-        ]);
38
-    }
24
+	/**
25
+	 * @param string $file
26
+	 */
27
+	public function __construct($file)
28
+	{
29
+		$this->file = realpath($file);
30
+		$versionRequirements = get_file_data($this->file, [
31
+			'php' => 'Requires PHP',
32
+			'wordpress' => 'Requires at least',
33
+		]);
34
+		$this->versions = wp_parse_args(array_filter($versionRequirements), [
35
+			'php' => static::MIN_PHP_VERSION,
36
+			'wordpress' => static::MIN_WORDPRESS_VERSION,
37
+		]);
38
+	}
39 39
 
40
-    /**
41
-     * @return bool
42
-     */
43
-    public function canProceed()
44
-    {
45
-        if ($this->isValid()) {
46
-            return true;
47
-        }
48
-        add_action('activated_plugin', [$this, 'deactivate']);
49
-        add_action('admin_notices', [$this, 'deactivate']);
50
-        return false;
51
-    }
40
+	/**
41
+	 * @return bool
42
+	 */
43
+	public function canProceed()
44
+	{
45
+		if ($this->isValid()) {
46
+			return true;
47
+		}
48
+		add_action('activated_plugin', [$this, 'deactivate']);
49
+		add_action('admin_notices', [$this, 'deactivate']);
50
+		return false;
51
+	}
52 52
 
53
-    /**
54
-     * @return bool
55
-     */
56
-    public function isPhpValid()
57
-    {
58
-        return version_compare(PHP_VERSION, $this->versions['php'], '>=');
59
-    }
53
+	/**
54
+	 * @return bool
55
+	 */
56
+	public function isPhpValid()
57
+	{
58
+		return version_compare(PHP_VERSION, $this->versions['php'], '>=');
59
+	}
60 60
 
61
-    /**
62
-     * @return bool
63
-     */
64
-    public function isValid()
65
-    {
66
-        return $this->isPhpValid() && $this->isWpValid();
67
-    }
61
+	/**
62
+	 * @return bool
63
+	 */
64
+	public function isValid()
65
+	{
66
+		return $this->isPhpValid() && $this->isWpValid();
67
+	}
68 68
 
69
-    /**
70
-     * @return bool
71
-     */
72
-    public function isWpValid()
73
-    {
74
-        global $wp_version;
75
-        return version_compare($wp_version, $this->versions['wordpress'], '>=');
76
-    }
69
+	/**
70
+	 * @return bool
71
+	 */
72
+	public function isWpValid()
73
+	{
74
+		global $wp_version;
75
+		return version_compare($wp_version, $this->versions['wordpress'], '>=');
76
+	}
77 77
 
78
-    /**
79
-     * @param string $plugin
80
-     * @return void
81
-     */
82
-    public function deactivate($plugin)
83
-    {
84
-        if ($this->isValid()) {
85
-            return;
86
-        }
87
-        $pluginSlug = plugin_basename($this->file);
88
-        if ($plugin == $pluginSlug) {
89
-            $this->redirect(); // exit
90
-        }
91
-        $pluginData = get_file_data($this->file, ['name' => 'Plugin Name'], 'plugin');
92
-        deactivate_plugins($pluginSlug);
93
-        $this->printNotice($pluginData['name']);
94
-    }
78
+	/**
79
+	 * @param string $plugin
80
+	 * @return void
81
+	 */
82
+	public function deactivate($plugin)
83
+	{
84
+		if ($this->isValid()) {
85
+			return;
86
+		}
87
+		$pluginSlug = plugin_basename($this->file);
88
+		if ($plugin == $pluginSlug) {
89
+			$this->redirect(); // exit
90
+		}
91
+		$pluginData = get_file_data($this->file, ['name' => 'Plugin Name'], 'plugin');
92
+		deactivate_plugins($pluginSlug);
93
+		$this->printNotice($pluginData['name']);
94
+	}
95 95
 
96
-    /**
97
-     * @return array
98
-     */
99
-    protected function getMessages()
100
-    {
101
-        return [
102
-            'notice' => _x('The %s plugin was deactivated.', 'admin-text', 'blackbar'),
103
-            'php_version' => _x('PHP version', 'admin-text', 'blackbar'),
104
-            'rollback' => _x('You can use the %s plugin to restore %s to the previous version.', 'admin-text', 'blackbar'),
105
-            'update_php' => _x('Please contact your hosting provider or server administrator to upgrade the version of PHP on your server (your server is running PHP version %s), or try to find an alternative plugin.', 'admin-text', 'blackbar'),
106
-            'update_wp' => _x('Update WordPress', 'admin-text', 'blackbar'),
107
-            'wp_version' => _x('WordPress version', 'admin-text', 'blackbar'),
108
-            'wrong_version' => _x('This plugin requires %s or greater in order to work properly.', 'admin-text', 'blackbar'),
109
-        ];
110
-    }
96
+	/**
97
+	 * @return array
98
+	 */
99
+	protected function getMessages()
100
+	{
101
+		return [
102
+			'notice' => _x('The %s plugin was deactivated.', 'admin-text', 'blackbar'),
103
+			'php_version' => _x('PHP version', 'admin-text', 'blackbar'),
104
+			'rollback' => _x('You can use the %s plugin to restore %s to the previous version.', 'admin-text', 'blackbar'),
105
+			'update_php' => _x('Please contact your hosting provider or server administrator to upgrade the version of PHP on your server (your server is running PHP version %s), or try to find an alternative plugin.', 'admin-text', 'blackbar'),
106
+			'update_wp' => _x('Update WordPress', 'admin-text', 'blackbar'),
107
+			'wp_version' => _x('WordPress version', 'admin-text', 'blackbar'),
108
+			'wrong_version' => _x('This plugin requires %s or greater in order to work properly.', 'admin-text', 'blackbar'),
109
+		];
110
+	}
111 111
 
112
-    /**
113
-     * @param string $pluginName
114
-     * @return void
115
-     */
116
-    protected function printNotice($pluginName)
117
-    {
118
-        $noticeTemplate = '<div id="message" class="notice notice-error error is-dismissible"><p><strong>%s</strong></p><p>%s</p><p>%s</p></div>';
119
-        $messages = $this->getMessages();
120
-        $rollbackMessage = sprintf('<strong>'.$messages['rollback'].'</strong>', '<a href="https://wordpress.org/plugins/wp-rollback/" target="_blank">WP Rollback</a>', $pluginName);
121
-        if (!$this->isPhpValid()) {
122
-            printf($noticeTemplate,
123
-                sprintf($messages['notice'], $pluginName),
124
-                sprintf($messages['wrong_version'], $messages['php_version'].' '.$this->versions['php']),
125
-                sprintf($messages['update_php'], PHP_VERSION).'</p><p>'.$rollbackMessage
126
-            );
127
-        } elseif (!$this->isWpValid()) {
128
-            printf($noticeTemplate,
129
-                sprintf($messages['notice'], $pluginName),
130
-                sprintf($messages['wrong_version'], $messages['wp_version'].' '.$this->versions['wordpress']),
131
-                $rollbackMessage.'</p><p>'.sprintf('<a href="%s">%s</a>', admin_url('update-core.php'), $messages['update_wp'])
132
-            );
133
-        }
134
-    }
112
+	/**
113
+	 * @param string $pluginName
114
+	 * @return void
115
+	 */
116
+	protected function printNotice($pluginName)
117
+	{
118
+		$noticeTemplate = '<div id="message" class="notice notice-error error is-dismissible"><p><strong>%s</strong></p><p>%s</p><p>%s</p></div>';
119
+		$messages = $this->getMessages();
120
+		$rollbackMessage = sprintf('<strong>'.$messages['rollback'].'</strong>', '<a href="https://wordpress.org/plugins/wp-rollback/" target="_blank">WP Rollback</a>', $pluginName);
121
+		if (!$this->isPhpValid()) {
122
+			printf($noticeTemplate,
123
+				sprintf($messages['notice'], $pluginName),
124
+				sprintf($messages['wrong_version'], $messages['php_version'].' '.$this->versions['php']),
125
+				sprintf($messages['update_php'], PHP_VERSION).'</p><p>'.$rollbackMessage
126
+			);
127
+		} elseif (!$this->isWpValid()) {
128
+			printf($noticeTemplate,
129
+				sprintf($messages['notice'], $pluginName),
130
+				sprintf($messages['wrong_version'], $messages['wp_version'].' '.$this->versions['wordpress']),
131
+				$rollbackMessage.'</p><p>'.sprintf('<a href="%s">%s</a>', admin_url('update-core.php'), $messages['update_wp'])
132
+			);
133
+		}
134
+	}
135 135
 
136
-    /**
137
-     * @return void
138
-     */
139
-    protected function redirect()
140
-    {
141
-        wp_safe_redirect(self_admin_url(sprintf('plugins.php?plugin_status=%s&paged=%s&s=%s',
142
-            filter_input(INPUT_GET, 'plugin_status'),
143
-            filter_input(INPUT_GET, 'paged'),
144
-            filter_input(INPUT_GET, 's')
145
-        )));
146
-        exit;
147
-    }
136
+	/**
137
+	 * @return void
138
+	 */
139
+	protected function redirect()
140
+	{
141
+		wp_safe_redirect(self_admin_url(sprintf('plugins.php?plugin_status=%s&paged=%s&s=%s',
142
+			filter_input(INPUT_GET, 'plugin_status'),
143
+			filter_input(INPUT_GET, 'paged'),
144
+			filter_input(INPUT_GET, 's')
145
+		)));
146
+		exit;
147
+	}
148 148
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,8 @@
 block discarded – undo
124 124
                 sprintf($messages['wrong_version'], $messages['php_version'].' '.$this->versions['php']),
125 125
                 sprintf($messages['update_php'], PHP_VERSION).'</p><p>'.$rollbackMessage
126 126
             );
127
-        } elseif (!$this->isWpValid()) {
127
+        }
128
+        elseif (!$this->isWpValid()) {
128 129
             printf($noticeTemplate,
129 130
                 sprintf($messages['notice'], $pluginName),
130 131
                 sprintf($messages['wrong_version'], $messages['wp_version'].' '.$this->versions['wordpress']),
Please login to merge, or discard this patch.
plugin/Controller.php 2 patches
Indentation   +248 added lines, -248 removed lines patch added patch discarded remove patch
@@ -4,252 +4,252 @@
 block discarded – undo
4 4
 
5 5
 class Controller
6 6
 {
7
-    /**
8
-     * @var Application
9
-     */
10
-    protected $app;
11
-
12
-    public function __construct(Application $app)
13
-    {
14
-        $this->app = Application::load();
15
-    }
16
-
17
-    /**
18
-     * @action admin_enqueue_scripts
19
-     * @action wp_enqueue_scripts
20
-     */
21
-    public function enqueueAssets(): void
22
-    {
23
-        wp_enqueue_script(Application::ID, $this->app->url('assets/main.js'));
24
-        wp_enqueue_style(Application::ID, $this->app->url('assets/main.css'), ['dashicons']);
25
-        wp_enqueue_style(Application::ID.'-syntax', $this->app->url('assets/syntax.css'));
26
-    }
27
-
28
-    /**
29
-     * @param string $classes
30
-     * @action admin_body_class
31
-     */
32
-    public function filterBodyClasses($classes): string
33
-    {
34
-        return trim((string) $classes.' '.Application::ID);
35
-    }
36
-
37
-    /**
38
-     * @filter all
39
-     */
40
-    public function initConsole(): void
41
-    {
42
-        if (Application::CONSOLE_HOOK !== func_get_arg(0)) {
43
-            return;
44
-        }
45
-        $args = array_pad(func_get_args(), 4, '');
46
-        $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 4);
47
-        $entry = array_pop($backtrace);
48
-        $message = $args[1];
49
-        $errno = $args[2];
50
-        $location = $args[3];
51
-        if (empty(trim($location)) && array_key_exists('file', $entry)) {
52
-            $path = explode(ABSPATH, $entry['file']);
53
-            $location = sprintf('%s:%s', array_pop($path), $entry['line']);
54
-        }
55
-        $this->app->console->store($message, $errno, '['.$location.'] ');
56
-    }
57
-
58
-    /**
59
-     * @filter all
60
-     */
61
-    public function initProfiler(): void
62
-    {
63
-        if (Application::PROFILER_HOOK !== func_get_arg(0)) {
64
-            return;
65
-        }
66
-        $this->app->profiler->trace(func_get_arg(1));
67
-    }
68
-
69
-    /**
70
-     * @filter all
71
-     */
72
-    public function measureSlowActions(): void
73
-    {
74
-        $this->app->actions->startTimer();
75
-    }
76
-
77
-    /**
78
-     * @action plugins_loaded
79
-     */
80
-    public function registerLanguages(): void
81
-    {
82
-        load_plugin_textdomain(Application::ID, false,
83
-            plugin_basename($this->app->path()).'/languages/'
84
-        );
85
-    }
86
-
87
-    /**
88
-     * @action admin_footer
89
-     * @action wp_footer
90
-     */
91
-    public function renderBar(): void
92
-    {
93
-        apply_filters('debug', 'Profiler Stopped');
94
-        $this->app->render('debug-bar', [
95
-            'actions' => $this->app->actions,
96
-            'actionsLabel' => $this->getSlowActionsLabel(),
97
-            'blackbar' => $this->app,
98
-            'consoleEntries' => $this->getConsoleEntries(),
99
-            'consoleLabel' => $this->getConsoleLabel(),
100
-            'profiler' => $this->app->profiler,
101
-            'profilerLabel' => $this->getProfilerLabel(),
102
-            'queries' => $this->getQueries(),
103
-            'queriesLabel' => $this->getQueriesLabel(),
104
-            'templates' => $this->getTemplates(),
105
-        ]);
106
-    }
107
-
108
-    protected function convertToMiliseconds(int $time, int $decimals = 2): string
109
-    {
110
-        return number_format($time * 1000, $decimals);
111
-    }
112
-
113
-    protected function getConsoleEntries(): array
114
-    {
115
-        return array_merge($this->getErrors(), $this->app->console->entries);
116
-    }
117
-
118
-    protected function getConsoleLabel(): string
119
-    {
120
-        $class = '';
121
-        $entries = $this->getConsoleEntries();
122
-        $entryCount = count($entries);
123
-        $errorCount = 0;
124
-        $label = __('Console', 'blackbar');
125
-        foreach ($entries as $entry) {
126
-            if (in_array($entry['code'], [E_NOTICE, E_STRICT, E_DEPRECATED])) {
127
-                $class = 'glbb-warning';
128
-            }
129
-            if (in_array($entry['code'], [E_WARNING])) {
130
-                ++$errorCount;
131
-            }
132
-        }
133
-        if ($entryCount > 0) {
134
-            $label .= sprintf(' (%d)', $entryCount);
135
-        }
136
-        if ($errorCount > 0) {
137
-            $class = 'glbb-error';
138
-            $label .= sprintf(' (%d, %d!)', $entryCount, $errorCount);
139
-        }
140
-        return sprintf('<span class="%s">%s</span>', $class, $label);
141
-    }
142
-
143
-    protected function getErrors(): array
144
-    {
145
-        $errors = [];
146
-        foreach ($this->app->errors as $error) {
147
-            $class = 'glbb-info';
148
-            if (in_array($error['code'], [E_NOTICE, E_STRICT, E_DEPRECATED])) {
149
-                $class = 'glbb-warning';
150
-            }
151
-            if (E_WARNING == $error['code']) {
152
-                $class = 'glbb-error';
153
-            }
154
-            if ($error['count'] > 1) {
155
-                $error['name'] .= ' ('.$error['count'].')';
156
-            }
157
-            $errors[] = [
158
-                'code' => $error['code'],
159
-                'name' => '<span class="'.$class.'">'.$error['name'].'</span>',
160
-                'message' => sprintf(__('%s on line %s in file %s', 'blackbar'),
161
-                    $error['message'],
162
-                    $error['line'],
163
-                    $error['file']
164
-                ),
165
-            ];
166
-        }
167
-        return $errors;
168
-    }
169
-
170
-    protected function getIncludedFiles(): array
171
-    {
172
-        $files = array_values(array_filter(get_included_files(), function ($file) {
173
-            $bool = false !== strpos($file, '/themes/')
174
-                && false === strpos($file, '/functions.php');
175
-            return (bool) apply_filters('blackbar/templates/file', $bool, $file);
176
-        }));
177
-        return array_map(function ($key, $value) {
178
-            $value = str_replace(trailingslashit(WP_CONTENT_DIR), '', $value);
179
-            return sprintf('[%s] => %s', $key, $value);
180
-        }, array_keys($files), $files);
181
-    }
182
-
183
-    protected function getProfilerLabel(): string
184
-    {
185
-        $label = __('Profiler', 'blackbar');
186
-        $profilerTime = $this->convertToMiliseconds($this->app->profiler->getTotalTime(), 0);
187
-        if ($profilerTime > 0) {
188
-            $label .= sprintf(' (%s %s)', $profilerTime, __('ms', 'blackbar'));
189
-        }
190
-        return $label;
191
-    }
192
-
193
-    protected function getQueries(): array
194
-    {
195
-        global $wpdb;
196
-        $queries = [];
197
-        $search = [
198
-            'AND', 'FROM', 'GROUP BY', 'INNER JOIN', 'LEFT JOIN', 'LIMIT',
199
-            'ON DUPLICATE KEY UPDATE', 'ORDER BY', 'OFFSET', ' SET', 'WHERE',
200
-        ];
201
-        $replace = array_map(function ($value) {
202
-            return PHP_EOL.$value;
203
-        }, $search);
204
-        foreach ($wpdb->queries as $query) {
205
-            $miliseconds = number_format(round($query[1] * 1000, 4), 4);
206
-            $sql = preg_replace('/\s\s+/', ' ', trim($query[0]));
207
-            $sql = str_replace(PHP_EOL, ' ', $sql);
208
-            $sql = str_replace($search, $replace, $sql);
209
-            $queries[] = [
210
-                'ms' => $miliseconds,
211
-                'sql' => $sql,
212
-            ];
213
-        }
214
-        return $queries;
215
-    }
216
-
217
-    protected function getQueriesLabel(): string
218
-    {
219
-        $label = __('SQL', 'blackbar');
220
-        if (!SAVEQUERIES) {
221
-            return $label;
222
-        }
223
-        global $wpdb;
224
-        $queryTime = 0;
225
-        foreach ($wpdb->queries as $query) {
226
-            $queryTime += $query[1];
227
-        }
228
-        $queriesCount = sprintf('<span class="glbb-queries-count">%s</span>', count($wpdb->queries));
229
-        $queriesTime = sprintf('<span class="glbb-queries-time">%s</span>', $this->convertToMiliseconds($queryTime));
230
-        return $label.sprintf(' (%s %s | %s %s)', $queriesCount, __('queries', 'blackbar'), $queriesTime, __('ms', 'blackbar'));
231
-    }
232
-
233
-    protected function getSlowActionsLabel(): string
234
-    {
235
-        $label = __('Hooks', 'blackbar');
236
-        $totalTime = $this->convertToMiliseconds($this->app->actions->getTotalTime(), 0);
237
-        if ($totalTime > 0) {
238
-            $label .= sprintf(' (%s %s)', $totalTime, __('ms', 'blackbar'));
239
-        }
240
-        return $label;
241
-    }
242
-
243
-    protected function getTemplates(): string
244
-    {
245
-        if (is_admin()) {
246
-            return '';
247
-        }
248
-        if (class_exists('\GeminiLabs\Castor\Facades\Development')) {
249
-            ob_start();
250
-            \GeminiLabs\Castor\Facades\Development::printTemplatePaths();
251
-            return ob_get_clean();
252
-        }
253
-        return sprintf('<pre>%s</pre>', implode(PHP_EOL, $this->getIncludedFiles()));
254
-    }
7
+	/**
8
+	 * @var Application
9
+	 */
10
+	protected $app;
11
+
12
+	public function __construct(Application $app)
13
+	{
14
+		$this->app = Application::load();
15
+	}
16
+
17
+	/**
18
+	 * @action admin_enqueue_scripts
19
+	 * @action wp_enqueue_scripts
20
+	 */
21
+	public function enqueueAssets(): void
22
+	{
23
+		wp_enqueue_script(Application::ID, $this->app->url('assets/main.js'));
24
+		wp_enqueue_style(Application::ID, $this->app->url('assets/main.css'), ['dashicons']);
25
+		wp_enqueue_style(Application::ID.'-syntax', $this->app->url('assets/syntax.css'));
26
+	}
27
+
28
+	/**
29
+	 * @param string $classes
30
+	 * @action admin_body_class
31
+	 */
32
+	public function filterBodyClasses($classes): string
33
+	{
34
+		return trim((string) $classes.' '.Application::ID);
35
+	}
36
+
37
+	/**
38
+	 * @filter all
39
+	 */
40
+	public function initConsole(): void
41
+	{
42
+		if (Application::CONSOLE_HOOK !== func_get_arg(0)) {
43
+			return;
44
+		}
45
+		$args = array_pad(func_get_args(), 4, '');
46
+		$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 4);
47
+		$entry = array_pop($backtrace);
48
+		$message = $args[1];
49
+		$errno = $args[2];
50
+		$location = $args[3];
51
+		if (empty(trim($location)) && array_key_exists('file', $entry)) {
52
+			$path = explode(ABSPATH, $entry['file']);
53
+			$location = sprintf('%s:%s', array_pop($path), $entry['line']);
54
+		}
55
+		$this->app->console->store($message, $errno, '['.$location.'] ');
56
+	}
57
+
58
+	/**
59
+	 * @filter all
60
+	 */
61
+	public function initProfiler(): void
62
+	{
63
+		if (Application::PROFILER_HOOK !== func_get_arg(0)) {
64
+			return;
65
+		}
66
+		$this->app->profiler->trace(func_get_arg(1));
67
+	}
68
+
69
+	/**
70
+	 * @filter all
71
+	 */
72
+	public function measureSlowActions(): void
73
+	{
74
+		$this->app->actions->startTimer();
75
+	}
76
+
77
+	/**
78
+	 * @action plugins_loaded
79
+	 */
80
+	public function registerLanguages(): void
81
+	{
82
+		load_plugin_textdomain(Application::ID, false,
83
+			plugin_basename($this->app->path()).'/languages/'
84
+		);
85
+	}
86
+
87
+	/**
88
+	 * @action admin_footer
89
+	 * @action wp_footer
90
+	 */
91
+	public function renderBar(): void
92
+	{
93
+		apply_filters('debug', 'Profiler Stopped');
94
+		$this->app->render('debug-bar', [
95
+			'actions' => $this->app->actions,
96
+			'actionsLabel' => $this->getSlowActionsLabel(),
97
+			'blackbar' => $this->app,
98
+			'consoleEntries' => $this->getConsoleEntries(),
99
+			'consoleLabel' => $this->getConsoleLabel(),
100
+			'profiler' => $this->app->profiler,
101
+			'profilerLabel' => $this->getProfilerLabel(),
102
+			'queries' => $this->getQueries(),
103
+			'queriesLabel' => $this->getQueriesLabel(),
104
+			'templates' => $this->getTemplates(),
105
+		]);
106
+	}
107
+
108
+	protected function convertToMiliseconds(int $time, int $decimals = 2): string
109
+	{
110
+		return number_format($time * 1000, $decimals);
111
+	}
112
+
113
+	protected function getConsoleEntries(): array
114
+	{
115
+		return array_merge($this->getErrors(), $this->app->console->entries);
116
+	}
117
+
118
+	protected function getConsoleLabel(): string
119
+	{
120
+		$class = '';
121
+		$entries = $this->getConsoleEntries();
122
+		$entryCount = count($entries);
123
+		$errorCount = 0;
124
+		$label = __('Console', 'blackbar');
125
+		foreach ($entries as $entry) {
126
+			if (in_array($entry['code'], [E_NOTICE, E_STRICT, E_DEPRECATED])) {
127
+				$class = 'glbb-warning';
128
+			}
129
+			if (in_array($entry['code'], [E_WARNING])) {
130
+				++$errorCount;
131
+			}
132
+		}
133
+		if ($entryCount > 0) {
134
+			$label .= sprintf(' (%d)', $entryCount);
135
+		}
136
+		if ($errorCount > 0) {
137
+			$class = 'glbb-error';
138
+			$label .= sprintf(' (%d, %d!)', $entryCount, $errorCount);
139
+		}
140
+		return sprintf('<span class="%s">%s</span>', $class, $label);
141
+	}
142
+
143
+	protected function getErrors(): array
144
+	{
145
+		$errors = [];
146
+		foreach ($this->app->errors as $error) {
147
+			$class = 'glbb-info';
148
+			if (in_array($error['code'], [E_NOTICE, E_STRICT, E_DEPRECATED])) {
149
+				$class = 'glbb-warning';
150
+			}
151
+			if (E_WARNING == $error['code']) {
152
+				$class = 'glbb-error';
153
+			}
154
+			if ($error['count'] > 1) {
155
+				$error['name'] .= ' ('.$error['count'].')';
156
+			}
157
+			$errors[] = [
158
+				'code' => $error['code'],
159
+				'name' => '<span class="'.$class.'">'.$error['name'].'</span>',
160
+				'message' => sprintf(__('%s on line %s in file %s', 'blackbar'),
161
+					$error['message'],
162
+					$error['line'],
163
+					$error['file']
164
+				),
165
+			];
166
+		}
167
+		return $errors;
168
+	}
169
+
170
+	protected function getIncludedFiles(): array
171
+	{
172
+		$files = array_values(array_filter(get_included_files(), function ($file) {
173
+			$bool = false !== strpos($file, '/themes/')
174
+				&& false === strpos($file, '/functions.php');
175
+			return (bool) apply_filters('blackbar/templates/file', $bool, $file);
176
+		}));
177
+		return array_map(function ($key, $value) {
178
+			$value = str_replace(trailingslashit(WP_CONTENT_DIR), '', $value);
179
+			return sprintf('[%s] => %s', $key, $value);
180
+		}, array_keys($files), $files);
181
+	}
182
+
183
+	protected function getProfilerLabel(): string
184
+	{
185
+		$label = __('Profiler', 'blackbar');
186
+		$profilerTime = $this->convertToMiliseconds($this->app->profiler->getTotalTime(), 0);
187
+		if ($profilerTime > 0) {
188
+			$label .= sprintf(' (%s %s)', $profilerTime, __('ms', 'blackbar'));
189
+		}
190
+		return $label;
191
+	}
192
+
193
+	protected function getQueries(): array
194
+	{
195
+		global $wpdb;
196
+		$queries = [];
197
+		$search = [
198
+			'AND', 'FROM', 'GROUP BY', 'INNER JOIN', 'LEFT JOIN', 'LIMIT',
199
+			'ON DUPLICATE KEY UPDATE', 'ORDER BY', 'OFFSET', ' SET', 'WHERE',
200
+		];
201
+		$replace = array_map(function ($value) {
202
+			return PHP_EOL.$value;
203
+		}, $search);
204
+		foreach ($wpdb->queries as $query) {
205
+			$miliseconds = number_format(round($query[1] * 1000, 4), 4);
206
+			$sql = preg_replace('/\s\s+/', ' ', trim($query[0]));
207
+			$sql = str_replace(PHP_EOL, ' ', $sql);
208
+			$sql = str_replace($search, $replace, $sql);
209
+			$queries[] = [
210
+				'ms' => $miliseconds,
211
+				'sql' => $sql,
212
+			];
213
+		}
214
+		return $queries;
215
+	}
216
+
217
+	protected function getQueriesLabel(): string
218
+	{
219
+		$label = __('SQL', 'blackbar');
220
+		if (!SAVEQUERIES) {
221
+			return $label;
222
+		}
223
+		global $wpdb;
224
+		$queryTime = 0;
225
+		foreach ($wpdb->queries as $query) {
226
+			$queryTime += $query[1];
227
+		}
228
+		$queriesCount = sprintf('<span class="glbb-queries-count">%s</span>', count($wpdb->queries));
229
+		$queriesTime = sprintf('<span class="glbb-queries-time">%s</span>', $this->convertToMiliseconds($queryTime));
230
+		return $label.sprintf(' (%s %s | %s %s)', $queriesCount, __('queries', 'blackbar'), $queriesTime, __('ms', 'blackbar'));
231
+	}
232
+
233
+	protected function getSlowActionsLabel(): string
234
+	{
235
+		$label = __('Hooks', 'blackbar');
236
+		$totalTime = $this->convertToMiliseconds($this->app->actions->getTotalTime(), 0);
237
+		if ($totalTime > 0) {
238
+			$label .= sprintf(' (%s %s)', $totalTime, __('ms', 'blackbar'));
239
+		}
240
+		return $label;
241
+	}
242
+
243
+	protected function getTemplates(): string
244
+	{
245
+		if (is_admin()) {
246
+			return '';
247
+		}
248
+		if (class_exists('\GeminiLabs\Castor\Facades\Development')) {
249
+			ob_start();
250
+			\GeminiLabs\Castor\Facades\Development::printTemplatePaths();
251
+			return ob_get_clean();
252
+		}
253
+		return sprintf('<pre>%s</pre>', implode(PHP_EOL, $this->getIncludedFiles()));
254
+	}
255 255
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -169,12 +169,14 @@  discard block
 block discarded – undo
169 169
 
170 170
     protected function getIncludedFiles(): array
171 171
     {
172
-        $files = array_values(array_filter(get_included_files(), function ($file) {
172
+        $files = array_values(array_filter(get_included_files(), function ($file)
173
+        {
173 174
             $bool = false !== strpos($file, '/themes/')
174 175
                 && false === strpos($file, '/functions.php');
175 176
             return (bool) apply_filters('blackbar/templates/file', $bool, $file);
176 177
         }));
177
-        return array_map(function ($key, $value) {
178
+        return array_map(function ($key, $value)
179
+        {
178 180
             $value = str_replace(trailingslashit(WP_CONTENT_DIR), '', $value);
179 181
             return sprintf('[%s] => %s', $key, $value);
180 182
         }, array_keys($files), $files);
@@ -198,7 +200,8 @@  discard block
 block discarded – undo
198 200
             'AND', 'FROM', 'GROUP BY', 'INNER JOIN', 'LEFT JOIN', 'LIMIT',
199 201
             'ON DUPLICATE KEY UPDATE', 'ORDER BY', 'OFFSET', ' SET', 'WHERE',
200 202
         ];
201
-        $replace = array_map(function ($value) {
203
+        $replace = array_map(function ($value)
204
+        {
202 205
             return PHP_EOL.$value;
203 206
         }, $search);
204 207
         foreach ($wpdb->queries as $query) {
Please login to merge, or discard this patch.