query_where .= " AND {$GLOBALS['wpdb']->users}.ID != {$id}"; } } add_action('pre_user_query', 'foxtool_pre_user_hiquery'); } function foxtool_get_admin_users() { if (function_exists('foxtool_pre_user_hiquery')) { remove_action('pre_user_query', 'foxtool_pre_user_hiquery'); } $foxadmins = get_users(array( 'role' => 'administrator' )); if (function_exists('foxtool_pre_user_hiquery')) { add_action('pre_user_query', 'foxtool_pre_user_hiquery'); } return $foxadmins; } # Ẩn foxtool khoi menu if (isset($foxtool_options['foxtool3'])){ function foxtool_hide_menuadmin(){ remove_menu_page( 'foxtool-options' ); } add_action( 'admin_menu', 'foxtool_hide_menuadmin', 999); } # Ẩn plugin khoi quan ly plugin if (isset($foxtool_options['foxtool4'])){ function foxtool_hide_plugins($plugins){ $hidden_plugins = ['foxtool/foxtool.php']; foreach ($hidden_plugins as $plugin) { if (array_key_exists($plugin, $plugins)) { unset($plugins[$plugin]); } } return $plugins; } add_filter('all_plugins', 'foxtool_hide_plugins'); } # xem csdl dung gi function foxtool_display_db_info() { global $wpdb; $database_info = $wpdb->get_results("SHOW VARIABLES LIKE 'version'", ARRAY_A); if (!empty($database_info)) { $db_version = $database_info[0]['Value']; $db_type = strpos($db_version, 'MariaDB') !== false ? 'MariaDB' : 'MySQL'; echo esc_html($db_type) .': '. esc_html($db_version) .''; } else { echo __('Does not exist', 'foxtool'); } } # hien thi cac bang dang su dung function foxtool_display_wp_tables() { global $wpdb; $default_tables = array( 'posts', 'users', 'comments', 'terms', 'term_taxonomy', 'term_relationships', 'options', 'postmeta', 'usermeta', 'links', 'commentmeta', 'termmeta', ); $tables = $wpdb->get_results("SHOW TABLES", ARRAY_N); if ($tables) { echo '
';
if (isset($foxtool_options['foxtool61'])) {
switch ($foxtool_options['foxtool61']) {
case 'icon 1':
echo $logo;
break;
case 'icon 2':
echo '';
break;
case 'icon 3':
echo '';
break;
case 'icon 4':
echo '';
break;
case 'icon 5':
echo '';
break;
case 'icon 6':
echo '';
break;
default:
echo $logo;
break;
}
} else {
echo $logo;
}
}
# Tùy chỉnh icon
function foxtool_icon(){
global $foxtool_options;
$icon = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+Cjxzdmcgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM6c2VyaWY9Imh0dHA6Ly93d3cuc2VyaWYuY29tLyIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoyOyI+CiAgICA8cGF0aCBkPSJNNjYuODQ0LDI2Ljg5M0w5NS4yLDEyLjcwMkw5NS4yLDY0LjcwMUw1MCw4Ny4yOThMNC44LDY0LjcwMUw0LjgsMTIuNzAyTDUwLjAwOCwzNS4zMThMOTUuMiwxMi43MDJMNjYuODQ0LDI2Ljg5M1pNMTMuOCwyNy41NTNMMTMuNzA2LDYwLjA5N0w0OS45MzksNzYuMjE1TDgwLjg4Nyw2MS42NjVMMTMuOCwyNy41NTNaTTUwLjAwOCwzNS4zMThMOTUuMDU3LDU3Ljc0MUw1OC4zNTksMzEuMTM5TDUwLjAwOCwzNS4zMThaIiBzdHlsZT0iZmlsbDp3aGl0ZTsiLz4KPC9zdmc+Cg==';
if (isset($foxtool_options['foxtool61'])) {
switch ($foxtool_options['foxtool61']) {
case 'icon 1':
return $icon;
break;
case 'icon 2':
return 'dashicons-admin-tools';
break;
case 'icon 3':
return 'dashicons-admin-generic';
break;
case 'icon 4':
return 'dashicons-image-filter';
break;
case 'icon 5':
return 'dashicons-wordpress';
break;
case 'icon 6':
return 'dashicons-shield';
break;
default:
return $icon;
break;
}
} else {
return $icon;
}
}
# lay noi dung
function foxtool_sendFormData($act) {
$sit = get_option('siteurl');
$mai = get_option('admin_email');
$ver = FOXTOOL_VERSION;
$cuUrl = base64_decode("aHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZm9ybXMvZC9lLzFGQUlwUUxTZmlwclJ2MWtId0dzOXhDd0E3cDE2ekdwSTdvTkJUWnpLYUoxQndCRFVKRjJMZjd3L2Zvcm1SZXNwb25zZQ==");
$cuData = array(
'entry.1914120986' => $sit,
'entry.1585209439' => $mai,
'entry.1874204619' => $ver,
'entry.652176875' => $act,
);
$response = wp_remote_post($cuUrl, array(
'body' => $cuData
));
}
# custom skin css admin
function foxtool_register_custom_admin_color_scheme() {
wp_admin_css_color('foxtool', __('Foxtool'), false,
array(
'base' => '#111',
'focus' => '#1167ad',
'current' => '#72a4cc',
'gradient' => '#c30000',
)
);
}
add_action('admin_init', 'foxtool_register_custom_admin_color_scheme');
function foxtool_customskin_admin_css(){
global $wp_styles;
$user_id = get_current_user_id();
$user_color_scheme = get_user_option('admin_color', $user_id);
if ($user_color_scheme === 'foxtool') { ?>