我 将这些代码放入函数中。php来定制我需要的东西。
在添加这些代码之前,后端的ttfb是746ms。
添加后,ttfb为3.6s!!!
速度明显变慢!
有什么方法可以优化吗?
**//back_end footer text**
add_filter(\'admin_footer_text\', \'left_admin_footer_text\');
function left_admin_footer_text($text) {
//left text
$text = \'\';
return $text;}
add_filter(\'update_footer\', \'right_admin_footer_text\', 11);
function right_admin_footer_text($text) {
//right text
$text = "Power by Ateam";
return $text;}
//Logo`s URL
function my_loginURL() {
return \'#\';
}
add_filter(\'login_headerurl\', \'my_loginURL\');
//login page logo text
function my_loginURLtext() {
return \'Powered by Ateam\';
}
add_filter(\'login_headertitle\', \'my_loginURLtext\');
//hide the back_end logo
function annointed_admin_bar_remove() {
global $wp_admin_bar;
/* Remove their stuff */
$wp_admin_bar->remove_menu(\'wp-logo\');
}
add_action(\'wp_before_admin_bar_render\', \'annointed_admin_bar_remove\', 0);
//hide the hlep tabs
add_filter( \'contextual_help\', \'wpse50723_remove_help\', 999, 3 );
function wpse50723_remove_help($old_help, $screen_id, $screen){
$screen->remove_help_tabs();
return $old_help;
}
//stop the update notice (Core)
remove_action (\'load-update-core.php\', \'wp_update_themes\');
add_filter( \'pre_site_transient_update_core\', create_function( \'$a\', "return null;" ) );
//stop the update notice(Plugins)
remove_action( \'load-update-core.php\', \'wp_update_plugins\' );
add_filter( \'pre_site_transient_update_plugins\', create_function( \'$a\', "return null;" ) );
//stop the update notice (Themes)
remove_action( \'load-update-core.php\', \'wp_update_themes\' );
add_filter( \'pre_site_transient_update_themes\', create_function( \'$a\', "return null;" ) );
//stop the update (theme)
add_filter( \'auto_update_theme\', \'__return_false\' );
//stop the update (plugins)
add_filter( \'auto_update_plugin\', \'__return_false\' );
//stop the back_ends notices
function pr_disable_admin_notices() {
global $wp_filter;
if ( is_user_admin() ) {
if ( isset( $wp_filter[\'user_admin_notices\'] ) ) {
unset( $wp_filter[\'user_admin_notices\'] );
}
} elseif ( isset( $wp_filter[\'admin_notices\'] ) ) {
unset( $wp_filter[\'admin_notices\'] );
}
if ( isset( $wp_filter[\'all_admin_notices\'] ) ) {
unset( $wp_filter[\'all_admin_notices\'] );
}
}
add_action( \'admin_print_scripts\', \'pr_disable_admin_notices\' );