/
home
/
altere25
/
labratnyc.com
/
wp-content
/
plugins
/
query-monitor
/
classes
/
/home/altere25/labratnyc.com/wp-content/plugins/query-monitor/classes
mkdir
upload
Name
Size
Mode
Actions
Activation.php
3038
0644
edit
dl
rm
ArrayAccess.php
1105
0644
edit
dl
rm
Backtrace.php
22887
0644
edit
dl
rm
Backtrace_Frame.php
870
0644
edit
dl
rm
CLI.php
1568
0644
edit
dl
rm
Collector.php
8707
0644
edit
dl
rm
Collectors.php
3445
0644
edit
dl
rm
Collector_Assets.php
14500
0644
edit
dl
rm
Component.php
3866
0644
edit
dl
rm
Component_Altis_Vendor.php
356
0644
edit
dl
rm
Component_Core.php
263
0644
edit
dl
rm
Component_Dropin.php
346
0644
edit
dl
rm
Component_MU_Plugin.php
333
0644
edit
dl
rm
Component_MU_Vendor.php
342
0644
edit
dl
rm
Component_Other.php
170
0644
edit
dl
rm
Component_PHP.php
221
0644
edit
dl
rm
Component_Plugin.php
324
0644
edit
dl
rm
Component_Stylesheet.php
341
0644
edit
dl
rm
Component_Template.php
278
0644
edit
dl
rm
Component_Unknown.php
866
0644
edit
dl
rm
Component_VIP_Plugin.php
346
0644
edit
dl
rm
Data.php
428
0644
edit
dl
rm
DataCollector.php
396
0644
edit
dl
rm
DB.php
1546
0644
edit
dl
rm
debug_bar.php
1713
0644
edit
dl
rm
debug_bar_panel.php
1446
0644
edit
dl
rm
Deprecated_Argument_Run.php
1035
0644
edit
dl
rm
Deprecated_Class_Run.php
966
0644
edit
dl
rm
Deprecated_Constructor_Run.php
1144
0644
edit
dl
rm
Deprecated_File_Included.php
1095
0644
edit
dl
rm
Deprecated_Function_Run.php
983
0644
edit
dl
rm
Deprecated_Hook_Run.php
1098
0644
edit
dl
rm
Dispatcher.php
5097
0644
edit
dl
rm
Dispatchers.php
1241
0644
edit
dl
rm
Doing_It_Wrong_Run.php
892
0644
edit
dl
rm
Frame_Registry.php
1456
0644
edit
dl
rm
Hook.php
1379
0644
edit
dl
rm
Output.php
923
0644
edit
dl
rm
PHP.php
1397
0644
edit
dl
rm
Plugin.php
2400
0644
edit
dl
rm
QM.php
4451
0644
edit
dl
rm
QueryMonitor.php
8705
0644
edit
dl
rm
Timer.php
3326
0644
edit
dl
rm
Util.php
19901
0644
edit
dl
rm
Wrong.php
822
0644
edit
dl
rm
Edit:
/home/altere25/labratnyc.com/wp-content/plugins/query-monitor/classes/Dispatcher.php
(5097B)
<?php declare(strict_types = 1); /** * Abstract dispatcher. * * @package query-monitor */ if ( ! class_exists( 'QM_Dispatcher' ) ) { abstract class QM_Dispatcher { /** * Outputter instances. * * @var array<string, QM_Output> Array of outputters. */ protected $outputters = array(); /** * Query Monitor plugin instance. * * @var QM_Plugin Plugin instance. */ protected $qm; /** * @var string */ public $id = ''; /** * @var bool */ protected $ceased = false; public function __construct( QM_Plugin $qm ) { $this->qm = $qm; if ( ! defined( 'QM_COOKIE' ) ) { define( 'QM_COOKIE', 'wp-query_monitor_' . COOKIEHASH ); } add_action( 'init', array( $this, 'init' ) ); } /** * @return bool */ abstract public function is_active(); /** * @param string $message * @param mixed[] $e * @phpstan-param array{ * message: string, * file: string, * line: int, * type?: int, * trace?: mixed|null, * } $e */ public function output_fatal( $message, array $e ): void { print_r( $e ); } /** * @return bool */ final public function should_dispatch() { $e = error_get_last(); # Don't dispatch if a fatal has occurred: if ( ! empty( $e ) && ( $e['type'] & QM_ERROR_FATALS ) ) { return false; } /** * Allows users to disable this dispatcher. * * The dynamic portion of the hook name, `$this->id`, refers to the dispatcher ID. * * Possible filter names include: * * - `qm/dispatch/html` * - `qm/dispatch/ajax` * - `qm/dispatch/redirect` * - `qm/dispatch/rest` * - `qm/dispatch/wp_die` * * @since 2.8.0 * * @param bool $true Whether or not the dispatcher is enabled. */ if ( ! apply_filters( "qm/dispatch/{$this->id}", true ) ) { return false; } return $this->is_active(); } /** * @return void */ public function cease() { $this->ceased = true; add_filter( "qm/dispatch/{$this->id}", '__return_false' ); } /** * Processes and fetches the outputters for this dispatcher. * * @param string $outputter_id The outputter ID. * @return array<string, QM_Output> Array of outputters. */ public function get_outputters( $outputter_id ) { $collectors = QM_Collectors::init(); $collectors->process(); /** * Allows users to filter what outputs. * * The dynamic portion of the hook name, `$outputter_id`, refers to the outputter ID. * * @since 2.8.0 * * @param array<string, QM_Output> $outputters Array of outputters. * @param QM_Collectors $collectors List of collectors. */ $this->outputters = apply_filters( "qm/outputter/{$outputter_id}", array(), $collectors ); return $this->outputters; } /** * @return void */ public function init() { if ( ! self::user_can_view() ) { do_action( 'qm/cease' ); return; } if ( ! defined( 'DONOTCACHEPAGE' ) ) { define( 'DONOTCACHEPAGE', 1 ); } add_action( 'send_headers', 'nocache_headers' ); } /** * @return void */ protected function before_output() { } /** * @return void */ protected function after_output() { } /** * @return bool */ public static function user_can_view() { if ( ! did_action( 'plugins_loaded' ) ) { return false; } if ( current_user_can( 'view_query_monitor' ) ) { return true; } return self::user_verified(); } /** * @return bool */ public static function user_verified() { if ( isset( $_COOKIE[QM_COOKIE] ) ) { // phpcs:ignore return self::verify_cookie( wp_unslash( $_COOKIE[QM_COOKIE] ) ); // phpcs:ignore } return false; } /** * @deprecated * * @return string */ public static function editor_cookie() { return ''; } /** * @param string $value * @return bool */ public static function verify_cookie( $value ) { $old_user_id = wp_validate_auth_cookie( $value, 'logged_in' ); if ( $old_user_id ) { return user_can( $old_user_id, 'view_query_monitor' ); } return false; } /** * Attempts to switch to the given locale. * * This is a wrapper around `switch_to_locale()` which is safe to call at any point, even * before the `$wp_locale_switcher` global is initialised. * * @param string $locale The locale. * @return bool True on success, false on failure. */ public static function switch_to_locale( $locale ) { /** @var ?WP_Locale_Switcher $wp_locale_switcher */ global $wp_locale_switcher; if ( $wp_locale_switcher instanceof WP_Locale_Switcher ) { return switch_to_locale( $locale ); } return false; } /** * Attempts to restore the previous locale. * * This is a wrapper around `restore_previous_locale()` which is safe to call at any point, even * before the `$wp_locale_switcher` global is initialised. * * @return string|false Locale on success, false on error. */ public static function restore_previous_locale() { /** @var ?WP_Locale_Switcher $wp_locale_switcher */ global $wp_locale_switcher; if ( $wp_locale_switcher instanceof WP_Locale_Switcher ) { return restore_previous_locale(); } return false; } } }
Save
cmd:
run