-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofiler.php
More file actions
36 lines (29 loc) · 852 Bytes
/
Copy pathprofiler.php
File metadata and controls
36 lines (29 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Plugin Name: Profiler
* Description: Profiler and web debug toolbar for the WordPress kernel.
* Version: 1.0.0
* Requires at least: 6.9
* Requires PHP: 8.5
* Author: Brian Schäffner
* License: GPL-2.0-or-later
*/
declare(strict_types=1);
namespace SymPress\Profiler;
if (!defined('ABSPATH')) {
return;
}
$environment = function_exists('wp_get_environment_type') ? wp_get_environment_type() : null;
$debugEnvironment = defined('WP_DEBUG') && WP_DEBUG;
$saveQueriesEnabled = defined('SYMPRESS_PROFILER_SAVEQUERIES')
? (bool) constant('SYMPRESS_PROFILER_SAVEQUERIES')
: ($debugEnvironment && $environment === 'local');
if (
!defined('SAVEQUERIES')
&& $saveQueriesEnabled
) {
define('SAVEQUERIES', true);
}
if (!class_exists(ProfilerBundle::class)) {
require_once __DIR__ . '/vendor/autoload.php';
}