Server IP : 172.67.158.161 / Your IP : 3.145.74.249 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/home/giankuin/dietcontrungnhanh.com/wp-content/plugins/perfmatters/inc/classes/ |
Upload File : |
<?php namespace Perfmatters; use WP_Admin_Bar; class Config { public static $options; public static $tools; //initialize config public static function init() { //load plugin options self::$options = get_option('perfmatters_options'); self::$tools = get_option('perfmatters_tools'); //actions add_action('admin_bar_menu', array('Perfmatters\Config', 'admin_bar_menu'), 500); add_action('wp', array('Perfmatters\Config', 'queue')); } //setup admin bar menu public static function admin_bar_menu(WP_Admin_Bar $wp_admin_bar) { if(!current_user_can('manage_options') || !perfmatters_network_access() || !empty(self::$tools['hide_admin_bar_menu'])) { return; } //add top level menu item $wp_admin_bar->add_menu(array( 'id' => 'perfmatters', 'title' => 'Perfmatters', 'href' => admin_url('options-general.php?page=perfmatters') )); } //run the queue public static function queue() { //inital checks if(is_admin() || perfmatters_is_dynamic_request() || perfmatters_is_page_builder() || isset($_GET['perfmatters']) || isset($_GET['perfmattersoff'])) { return; } //logged in check if(!empty(self::$tools['disable_logged_in']) && is_user_logged_in()) { return; } //user agent check if(!empty($_SERVER['HTTP_USER_AGENT'])) { $excluded_agents = array( 'usercentrics' ); foreach($excluded_agents as $agent) { if(stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== false) { return; } } } do_action('perfmatters_queue'); } }