cloudflare免费版仅支持3个page rule,想要适当的缓存wordpress网站,需要费点心思。
不多说,直接上规则(以本站域名为例): 继续阅读wordpress在cloudflare免费版上的最佳缓存方案
cloudflare免费版仅支持3个page rule,想要适当的缓存wordpress网站,需要费点心思。
不多说,直接上规则(以本站域名为例): 继续阅读wordpress在cloudflare免费版上的最佳缓存方案
cyberpanel的管理端口是8090,这个端口cloudflare是不支持的,怎么办?
办法就是把8090端口去掉。
第一步是新建 域名网站,类似 www.example.com
第二步,为上面的域名签发证书
第三步,修改/usr/local/lsws/conf/httpd_config.conf,添加以下内容
extprocessor cyberpanel {
type proxy
address https://127.0.0.1:8090
maxConns 100
pcKeepAliveTimeout 60
initTimeout 60
retryTimeout 0
respBuffer 0
}
第四步,修改rewriterule如下:
REWRITERULE ^(.*)$ HTTP://cyberpanel/$1 [P]
● railgun.service – LSB: Railgun listener
Loaded: loaded (/etc/rc.d/init.d/railgun; bad; vendor preset: disabled)
Active: failed (Result: resources) since Fri 2019-12-20 21:03:40 CST; 1min 51s ago
Docs: man:systemd-sysv-generator(8)
Process: 4142 ExecStart=/etc/rc.d/init.d/railgun start (code=exited, status=0/SUCCESS)
railgun[4142]: Railgun successfully backgrounded, ensuring proper startup…
railgun[4142]: [FAILED]
railgun[4142]: Error starting Railgun as a daemon. Running in foreground…
su[4167]: (to railgun) root on none
railgun[4142]: Error starting: Error connecting to memcached server 127.0.0.1:11211: dial tcp 127.0.0.1:11211: connect: connection refused
railgun[4142]: [FAILED]
systemd[1]: New main PID 4169 does not exist or is a zombie.
systemd[1]: Failed to start LSB: Railgun listener.
systemd[1]: Unit railgun.service entered failed state.
systemd[1]: railgun.service failed.
include_once('../wp-load.php');
$t = ($_REQUEST['page'])?(int)$_REQUEST['page']:1;
$args = array(
'post_type' => 'post',
'posts_per_page' => 500,
'paged' => $t,
);
global $wp_query;
$wp_query = new WP_Query( $args );
while ( have_posts() ) {
the_post();
$table = get_the_content();
$table = unserialize($table);
array_walk($table,function(&$value,$key){
$value = preg_replace('/ ?/', ' ', $value);
$value = str_ireplace('', $value);
$value = str_ireplace('>>', '>', $value);
$value = str_ireplace('
', '
', $value);
});
$post = array(
'ID' => get_the_ID(),
'post_content' => serialize($table),
'tags_input' => analysis_keyword((preg_match_all('/[\x{4e00}-\x{9fff}]+/u', $table['标题'].$table['标题'].$table['标题'].$table['内容'].$table['回复'].$table['地点'], $matches)?implode('', $matches[0]):'')),
);
kses_remove_filters();
$post_id = wp_update_post( $post,$wp_error);
kses_init_filters();
}
$t++;
if($t < $wp_query->max_num_pages){
$url = "http://www.yaoruisheng.com/somewhere/modify.php?page=" . $t ;
header( 'refresh:3;url='.$url );
echo 'You\'ll be redirected in about 3 secs. If not, click here.';
} else {
echo 'done!';
}
WordPress-specific global variables are used throughout WordPress code for various reasons. Almost all data that WordPress generates can be found in a global variable.
Note that it’s best to use the appropriate API functions when available, instead of modifying globals directly.
To access a global variable in your code, you first need to globalize the variable with global $variable;
Accessing other globals besides the ones listed below is not recommended.
While inside the loop, these globals are set, containing information about the current post being processed.
These globals store data about which browser the user is on.
These globals store data about which web server WordPress is running on.
背景:页面通过cloudflare静态化缓存了,但是后台需要获取页面的访问数。
The key to creating a responsive YouTube embed is with padding and a container element, which allows you to give it a fixed aspect ratio. You can also use this technique with most other iframe-based embeds, such as slideshows. 继续阅读How To Make a Responsive 100% Width YouTube iFrame Embed
运行mysql
UPDATE `wp_posts` SET `post_password` = ” WHERE `post_type` = ‘post’;