前言
再次搬家,这次选用的是Cloudcone.
之前用的阿里云香港轻量云34元一月
后来使用pacificrack.com
,一年8美元.结果跑路了.
而且跑路的很突然,数据都还没来得及备份.
所以只能恢复到上次搬家时的数据.
过程
上次使用脚本oneinstack安装环境,由于插件没有正常工作,导致没有备份成功
所以这次选择了比较常用的宝塔
安装环境 略过不提
关于
云
使用的VPS是美国Cloudcone
洛杉矶机房DC2线路,这个商家的VPS我也用了五六年了,本次购买的是活动机型. 配置如下: 2核心 1G内存 55G SSD 1IPV4 3IPV6 价格不到18美刀,折合人民币130元
主题
主题使用argon
https://github.com/solstice23/argon-theme
插件
- WP SUPER CACHE
- WPJAM BASIC
- Redis Object Cache
- OSS Upload
- WP Githuber MD
Wordpress优化
在function.php
中添加以下代码
文章内链接在新窗口打开
function autoblank($text) {$return = str_replace('<a', '<a target="_blank"', $text);return $return;}add_filter('the_content', 'autoblank');
页面加载检测
//显示页面查询次数、加载时间和内存占用function performance( $visible = false ) { $stat = sprintf( '%d 次查询 耗时 %.3f seconds, 使用 %.2fMB 内存', get_num_queries(), timer_stop( 0, 3 ), memory_get_peak_usage() / 1024 / 1024 ); echo $visible ? $stat : "<!-- {$stat} -->" ;}
在合适位置添加
<?php if(function_exists('performance')) performance(true) ;?>
performance的参数 ture
表示在页面前端显示。
如果你想在页面中不显示,只在html源码中可见可改为 false
。