Skip to content

Commit

Permalink
v4.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
pryley committed May 8, 2024
1 parent 30c2c86 commit 19775d0
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 43 deletions.
22 changes: 9 additions & 13 deletions blackbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,22 @@
* Plugin Name: Black Bar
* Plugin URI: https://wordpress.org/plugins/blackbar
* Description: Black Bar is a Debug Bar for WordPress developers.
* Version: 4.0.3
* Version: 4.1.0
* Author: Paul Ryley
* Author URI: https://profiles.wordpress.org/pryley#content-plugins
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Requires at least: 5.8
* Requires PHP: 7.3
* Requires at least: 6.1
* Requires PHP: 7.4
* Text Domain: blackbar
* Domain Path: languages
*/
defined('ABSPATH') || exit;

if (!class_exists('GL_Plugin_Check_v6')) {
require_once __DIR__.'/activate.php';
}
if ((new GL_Plugin_Check_v6(__FILE__))->canProceed()) {
require_once __DIR__.'/autoload.php';
require_once __DIR__.'/compatibility.php';
if (!defined('SAVEQUERIES')) {
define('SAVEQUERIES', 1);
}
GeminiLabs\BlackBar\Application::load()->init();
require_once __DIR__.'/autoload.php';
require_once __DIR__.'/compatibility.php';

if (!defined('SAVEQUERIES')) {
define('SAVEQUERIES', 1);
}
GeminiLabs\BlackBar\Application::load()->init();
Binary file modified languages/blackbar-en_US.mo
Binary file not shown.
30 changes: 17 additions & 13 deletions languages/blackbar-en_US.po
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2023 blackbar
# Copyright (C) 2024 blackbar
# This file is distributed under the same license as the blackbar package.
msgid ""
msgstr ""
Expand Down Expand Up @@ -34,7 +34,7 @@ msgstr "Console"
msgid "Globals"
msgstr "Globals"

#: plugin/Modules/Hooks.php:57
#: plugin/Modules/Hooks.php:98
msgid "Hooks"
msgstr "Hooks"

Expand Down Expand Up @@ -86,39 +86,43 @@ msgstr "Unknown"
msgid "No entries found."
msgstr "No entries found."

#: views/panels/hooks.php:13
#: views/panels/hooks.php:14
msgid "(Slowest 50)"
msgstr "(Slowest 50)"

#: views/panels/hooks.php:18
msgid "Find callbacks containing"
msgstr "Find callbacks containing"

#: views/panels/hooks.php:14
#: views/panels/hooks.php:19
msgid "Minimum total time"
msgstr "Minimum total time"

#: views/panels/hooks.php:16
#: views/panels/hooks.php:21
msgid "Sort by total time"
msgstr "Sort by total time"

#: views/panels/hooks.php:17, views/panels/queries.php:17
#: views/panels/hooks.php:22, views/panels/queries.php:17
msgid "Sort by execution order"
msgstr "Sort by execution order"

#: views/panels/hooks.php:23
msgid "Action or Filter (Slowest 50)"
msgstr "Action or Filter (Slowest 50)"
#: views/panels/hooks.php:28
msgid "Action or Filter"
msgstr "Action or Filter"

#: views/panels/hooks.php:24
#: views/panels/hooks.php:29
msgid "Callbacks"
msgstr "Callbacks"

#: views/panels/hooks.php:25
#: views/panels/hooks.php:30
msgid "Calls"
msgstr "Calls"

#: views/panels/hooks.php:26
#: views/panels/hooks.php:31
msgid "Per Call"
msgstr "Per Call"

#: views/panels/hooks.php:27
#: views/panels/hooks.php:32
msgid "Total"
msgstr "Total"

Expand Down
28 changes: 16 additions & 12 deletions languages/blackbar.pot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2023 blackbar
# Copyright (C) 2024 blackbar
# This file is distributed under the same license as the blackbar package.
msgid ""
msgstr ""
Expand Down Expand Up @@ -67,7 +67,7 @@ msgstr ""
msgid "Globals"
msgstr ""

#: plugin/Modules/Hooks.php:57
#: plugin/Modules/Hooks.php:98
msgid "Hooks"
msgstr ""

Expand Down Expand Up @@ -119,39 +119,43 @@ msgstr ""
msgid "No entries found."
msgstr ""

#: views/panels/hooks.php:13
#: views/panels/hooks.php:14
msgid "(Slowest 50)"
msgstr ""

#: views/panels/hooks.php:18
msgid "Find callbacks containing"
msgstr ""

#: views/panels/hooks.php:14
#: views/panels/hooks.php:19
msgid "Minimum total time"
msgstr ""

#: views/panels/hooks.php:16
#: views/panels/hooks.php:21
msgid "Sort by total time"
msgstr ""

#: views/panels/hooks.php:17, views/panels/queries.php:17
#: views/panels/hooks.php:22, views/panels/queries.php:17
msgid "Sort by execution order"
msgstr ""

#: views/panels/hooks.php:23
msgid "Action or Filter (Slowest 50)"
#: views/panels/hooks.php:28
msgid "Action or Filter"
msgstr ""

#: views/panels/hooks.php:24
#: views/panels/hooks.php:29
msgid "Callbacks"
msgstr ""

#: views/panels/hooks.php:25
#: views/panels/hooks.php:30
msgid "Calls"
msgstr ""

#: views/panels/hooks.php:26
#: views/panels/hooks.php:31
msgid "Per Call"
msgstr ""

#: views/panels/hooks.php:27
#: views/panels/hooks.php:32
msgid "Total"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions plugin/Modules/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public function entries(): array
return [];
}
wp_raise_memory_limit('admin');
$hooks = [];
array_walk($this->entries, function (&$data) {
$total = $this->totalTimeForHook($data);
$perCall = (int) round($total / $data['count']);
Expand Down Expand Up @@ -153,7 +152,8 @@ protected function callbackFunction($function): string
if (is_a($function, 'Closure')) {
$ref = new \ReflectionFunction($function);
$vars = $ref->getStaticVariables();
if (isset($vars['callback'])
if (isset($vars['callback'])
&& is_array($vars['callback'])
&& 2 === count($vars['callback'])
&& is_string($vars['callback'][1])
) {
Expand Down
20 changes: 17 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: pryley, geminilabs
Donate link: https://ko-fi.com/pryley
Tags: blackbar, black bar, debug bar, debugbar, debugging, development, blackbox
Tested up to: 6.3
Stable tag: 4.0.3
Tested up to: 6.5
Stable tag: 4.1.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -55,12 +55,26 @@ To use the profiler, insert the following lines of PHP _before_ and _after_ the

= How do I enable the plugin for non-administrators? =

By default, Black Bar is only visible to administrator users. To enable it for all logged-in users, add the following code to your child theme's functions.php file:
By default, Black Bar is only visible to administrator users. To enable it for all logged-in users, use this code snippet:

`add_filter('blackbar/enabled', 'is_user_logged_in');`

= How do I change the number of slowest hooks displayed? =

By default, Black Bar displays the 50 slowest action/filter hooks. To display all hooks, use this code snippet:

`add_filter('blackbar/hooks/all', '__return_true');`

== Changelog ==

= 4.1.0 (2024-05-08) =

- Added "blackbar/hooks/all" filter hook
- Added highlighting of major WordPress hooks
- Added support for static callables used for hook callbacks in Site Reviews
- Change minimum PHP version to 7.4
- Change minimum WordPress version to 6.1

= 4.0.3 (2023-10-11) =

- Fixed debugging of non-scalar values
Expand Down

0 comments on commit 19775d0

Please sign in to comment.