<?php
/* Plugin Name: Move jQuery to the footer */
function( \'admin_enqueue_scripts\', function( $hook )
{
$GLOBALS[\'wp_scripts\']->add_data( \'jquery\', \'group\', 1 );
} );
查询另一个加快post列表屏幕速度的方法是减少查询字段的数量。不久前,我注意到了这个问题,当时由于我的999帖子设置,这些屏幕加载速度太慢。满的
blog post here - 插件
as GitHub Gist.
<?php
/**
* Plugin Name: (WCM) Faster Admin Post Lists
* AuthorURL: http://unserkaiser.com
* License: MIT
*/
add_filter( \'posts_fields\', \'wcm_limit_post_fields_cb\', 0, 2 );
function wcm_limit_post_fields_cb( $fields, $query )
{
if (
! is_admin()
OR ! $query->is_main_query()
OR ( defined( \'DOING_AJAX\' ) AND DOING_AJAX )
OR ( defined( \'DOING_CRON\' ) AND DOING_CRON )
)
return $fields;
$p = $GLOBALS[\'wpdb\']->posts;
return implode( ",", array(
"{$p}.ID",
"{$p}.post_date",
"{$p}.post_name",
"{$p}.post_title",
"{$p}.ping_status",
"{$p}.post_author",
"{$p}.post_password",
"{$p}.comment_status",
) );
}
如果您不需要所有列,您可以通过删除某些列的内容来扩展上述插件。
add_filter( \'manage_edit-post_columns\', function( $columns )
{
# @TODO Remove columns which you don\'t need
return $defaults;
} );
仪表板每个用户都进入仪表板-这可能是管理UI中最慢的部分。您可以停用一些不需要的小部件,而不仅仅是隐藏它们:
<?php
/** Plugin Name: Remove Dashboard Widgets */
add_action( \'wp_dashboard_setup\', function()
{
remove_meta_box( \'dashboard_plugins\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_primary\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_primary\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_activity\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_right_now\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_secondary\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_quick_press\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_browser_nag\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_recent_drafts\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_incoming_links\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_incoming_links\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_recent_comments\', \'dashboard\', \'normal\' );
} );
传出数据我建议使用
Snitch by Sergej Müller 监视试图离开安装的数据。该插件允许抑制所有或只是特定连接,以及针对不需要的cron作业和类似任务的特定于pin点的内部连接。如果不需要完整的软件包,可以查看其源代码以获取示例。Sergej通常编写非常可读的代码,并大量使用空格。