首页
统计
分类
tags
推荐
WordPress
Linux
Search
1
快速部署Xray V2ray SS Trojan Trojan-go七合一共存一键脚本+伪装博客
189 阅读
2
国外12个免费的DNS
138 阅读
3
让你的WP跑得更快 - WordPress优化指南
82 阅读
4
github 网页的新字体 -apple-system BlinkMacSystemFont 是什么
80 阅读
5
BBR Plus一键安装脚本 BBR/BBR Plus/魔改BBR/锐速(LotServer)四合一
77 阅读
Wordpress
Linux
Other
登录
Search
标签搜索
wordpress
SSR
LNMP
bbr
SSR - Bash
flashfxp
Facebook messenger
brotli
WooCommerce
Deepin
V2Ray
BBR Plus
yum
宝塔
SQLite
谷歌云
debian
Contact Form 7
reCAPTCHA
Ruinous
累计撰写
79
篇文章
累计收到
0
条评论
首页
栏目
Wordpress
Linux
Other
页面
统计
分类
tags
推荐
WordPress
Linux
搜索到
32
篇与
的结果
2022-08-18
WordPress安全 - 隐藏保护wp-login.php后台登陆入口
我们在基本的设置账户用户名和密码安全基础上,最好把这个登录入口限制访问或者隐藏,之前也有看到一些教程说安装插件,比如安装Stealth Login Page插件可以设置登录页面后的参数,与我要设置的非插件实现一样的。也可以使用Limit Login Attempts限制登录次数,如果超过一定次数就限制访问。我们能不用插件就不用插件,通过修改function.php文档的方法解决add_action('login_enqueue_scripts','login_protection'); function login_protection(){ if($_GET['root'] != 'ruinous')header('Location: https://ruinous.top/'); } 添加上面的脚本就可以,然后修改"ruinous""https://ruinous.top/"部分为自己需要的就可以,以后我们登录自己的WP网站只需要用到这样的后台路径。https://www.xinhuo.net/wp-login.php?root=ruinous
2022年08月18日
29 阅读
0 评论
0 点赞
2022-06-07
10 个提升 WordPress 网站运行速度的小技巧
前言WordPress 是全球用户最多的开源 PHP 网站程序,很多人通过 WordPress 搭建官网、博客、商城等各种网站。但是很多新手搭建的 WordPress 网站运行速度总是感觉不够理想,想要优化却又不知从何入手。今天 66哥 就整理一些所有人都能够通用的 WordPress 网站运行速度的小技巧分享给大家。步骤优化技巧 1 「去掉 emojis 表情图标」WordPress 默认调用 emojis 表情图标,但是绝大多数主题要么没有表情图标要么也是调用的其他的表情图标,所以我们可以禁用 emojis 表情。//禁止emojis表情 function disable_emojis() { remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( 'wp_print_styles', 'print_emoji_styles' ); remove_action( 'admin_print_styles', 'print_emoji_styles' ); remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' ); } add_action( 'init', 'disable_emojis' ); function disable_emojis_tinymce( $plugins ) { if ( is_array( $plugins ) ) { return array_diff( $plugins, array( 'wpemoji' ) ); } else { return array(); } } 优化技巧 2 「去除前端调用 JS、CSS 后缀版本号」//去除加载的css和js后面的版本号 function sb_remove_script_version( $src ){ $parts = explode( '?', $src ); return $parts[0]; } add_filter( 'script_loader_src', 'sb_remove_script_version', 15, 1 ); add_filter( 'style_loader_src', 'sb_remove_script_version', 15, 1 ); 优化技巧 3 「禁止自PING和版本保存」function no_self_ping( &$links ) { $home = get_option( 'home' ); foreach ( $links as $l => $link ) if ( 0 === strpos( $link, $home ) ) unset($links[$l]); } add_action( 'pre_ping', 'no_self_ping' ); remove_action('pre_post_update', 'wp_save_post_revision'); add_action('wp_print_scripts', 'disable_autosave'); function disable_autosave() { wp_deregister_script('autosave'); } 优化技巧 4 「禁止部分头部模块」remove_action( 'wp_head', 'wp_generator' ); remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); remove_action( 'wp_head', 'feed_links_extra', 3 ); remove_action( 'wp_head', 'feed_links', 2 ); remove_action( 'wp_head', 'rsd_link' ); remove_action( 'wp_head', 'wlwmanifest_link' ); remove_action( 'wp_head', 'index_rel_link' ); remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); 优化技巧 5 「关闭 XML-RPC」// 关闭 XML-RPC 功能 add_filter('xmlrpc_enabled', '__return_false'); 优化技巧 6 「关闭 REST API」很多 WordPress 主题是不需要 REST API 的,但是 WordPress 默认在前端加载了这个功能,我们可以禁用此功能。// 关闭 REST API add_filter('rest_enabled', '__return_false'); add_filter('rest_jsonp_enabled', '__return_false'); 优化技巧 7 「移除头部 JSON」//移除头部 wp-json 标签和 HTTP header 中的 link remove_action('wp_head', 'rest_output_link_wp_head', 10 ); remove_action('template_redirect', 'rest_output_link_header', 11 ); 优化技巧 8 「禁用 Gutenberg 编辑器」//禁用Gutenberg编辑器 add_filter('use_block_editor_for_post', '__return_false'); remove_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' ); 优化技巧 9 「将 jquery 文件移动到底部加载」//强制jquery库文件底部载入 function ds_print_jquery_in_footer( &$scripts) { if ( ! is_admin() ) $scripts->add_data( 'jquery', 'group', 1 ); } add_action( 'wp_default_scripts', 'ds_print_jquery_in_footer' ); 优化技巧 10 「网页链接后面增加反斜杠」// 页面链接后添加反斜杠 function itbulu_nice_trailingslashit($string, $type_of_url) { if ($type_of_url != 'single') $string = trailingslashit($string); return $string; } add_filter('user_trailingslashit', 'itbulu_nice_trailingslashit', 10, 2); 后语以上这些代码片段可以酌情选择添加到你的主题模板 functions.php 文件中即可生效。建议大家逐条测试,虽然这 10 条优化技巧绝大多数网站直接启用都没问题,但是有可能你的网站其他插件会与这些代码段产生冲突,比如:REST API 禁用,绝大多数网站都是不需要的,但我的网站主题就需要 REST API 功能,所以我不能禁用。
2022年06月07日
10 阅读
0 评论
0 点赞
2022-05-31
wordpress怎么禁止后台编辑主题和插件
禁止编辑主题和插件1、怎么禁止在线编辑主题和插件在网站根目录下的wp-config.php文件插入以下代码即可:define( 'DISALLOW_FILE_EDIT', true ); 2、怎么禁止升级、安装、编辑WordPress主题和插件在网站根目录下的 wp-config.php文件插入以下代码即可:define('DISALLOW_FILE_MODS',true); 温馨提示:如果添加了第二种代码,就没必要添加第一种了。此方法只能一定程度上增加WordPress的安全性,但是人家连服务器都可以访问,那上面的一切都是扯淡!
2022年05月31日
20 阅读
0 评论
0 点赞
2021-12-09
彻底关闭 WordPress 自动更新和更新检查功能,提高后台运行速度
WordPress 支持在后台就可以自动去检查 WordPress 核心代码,插件和主题的版本,并且支持自动更新,这是非常了不起的功能,让 WordPress 站点时时保持最新版,特别是有安全漏洞出现的时候。WordPress 自动更新的问题但是这样也造成了其他一些问题:WordPress 的更新服务器在国外,并且没有在国内开启加速服务,所以 WordPress 在后台检查更新的时候,可能因为各种原因无法顺畅连接上,然后一直卡着,造成 WordPress 后台有时很慢很慢。自动更新是好事,但是一些插件或者主题改动太大,造成了后台崩溃,那就不是好事了,特别是生产环境崩了,那就更不是什么好事了,所以对于一些敏感的系统,最好在测试服务器上升级并测试好之后,再到正式生产服务器上升级。所以综上所述,最好在正式服务器上关闭 WordPress 自动更新功能,在测试服务器上升级更新好之后,再更新到正式服务器,这样保证服务稳定,也能够让 WordPress 后台跑的更快。关闭自动更新和更新检查功能那么怎么关闭 WordPress 自动更新和后台更新检查呢?首先 WordPress 提供了一个常量:AUTOMATIC_UPDATER_DISABLED,在 wp-config.php 文件中将该值设置为 false,就可以关闭自定更新功能。如果不想改 wp-config.php 文件,WordPress 还提供了一个 automatic_updater_disabled 接口,通过它也可以关闭自动更新:add_filter('automatic_updater_disabled', '__return_true'); 不过你有没有访问后台,WordPress 都会定时检测 WordPress 核心,插件和主题是否有更新了,这个功能是通过定时作业实现的,一共有三个定时作业:wp_version_check:检测 WordPress 核心代码是不是最新版本。wp_update_plugins:检测 WordPress 插件是不是最新版。wp_update_themes:检测 WordPress 主题是不是最新版。这三个定时作业,每两天跑一次,不管有没有访问后台,他们都会运行检测你的站点是否需要更新。我们可以通过以下代码实现关闭定时更新检查的作业:remove_action('init', 'wp_schedule_update_checks'); wp_clear_scheduled_hook('wp_version_check'); wp_clear_scheduled_hook('wp_update_plugins'); wp_clear_scheduled_hook('wp_update_themes'); 除了定时作业之外,如果访问 WordPress 后台,WordPress 会每隔 12 小时,就会检测 WordPress 核心,插件和主题是否有更新了。这个就是 WordPress 有时很慢很慢的原因,因为很久没有访问 WordPress 后台,一访问 WordPress 就先去检测更新,所以就显得特别慢,感觉很明显,因为你访问,每隔 12 小时就会检测,所以造成很多人认为 WordPress 很慢。所以这个每隔 12 小时就检测更新的功能,尤其要关闭,这是后台提速的关键:remove_action('admin_init', '_maybe_update_core'); remove_action('admin_init', '_maybe_update_plugins'); remove_action('admin_init', '_maybe_update_themes'); 我们这样屏蔽之后,是不是后台就无法获得 WordPress 更新了呢?不是的,当我们进入 WordPress 后台插件管理页面,主题管理界面,以及仪表盘下的更新子页面,无论什么时候进入这个三个界面,WordPress 都会去检测是否有新版本的。add_filter('automatic_updater_disabled', '__return_true'); remove_action('init', 'wp_schedule_update_checks'); wp_clear_scheduled_hook('wp_version_check'); wp_clear_scheduled_hook('wp_update_plugins'); wp_clear_scheduled_hook('wp_update_themes'); remove_action('admin_init', '_maybe_update_core'); remove_action('admin_init', '_maybe_update_plugins'); remove_action('admin_init', '_maybe_update_themes'); //去除头部多余加载信息 remove_action( 'wp_head', 'wp_generator' );//移除WordPress版本 remove_action( 'wp_head', 'rsd_link' );//移除离线编辑器开放接口 remove_action( 'wp_head', 'wlwmanifest_link' );//移除离线编辑器开放接口 remove_action( 'wp_head', 'index_rel_link' );//去除本页唯一链接信息 remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); //清除前后文信息 remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );//清除前后文信息 remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );//清除前后文信息 remove_action( 'wp_head', 'feed_links', 2 );//移除文章和评论feed remove_action( 'wp_head', 'feed_links_extra', 3 ); //移除分类等feed remove_action( 'wp_head', 'rest_output_link_wp_head', 10 ); //移除wp-json remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); //头部的JS代码 add_filter( 'show_admin_bar', '__return_false' );//移除wp-json链接 remove_action( 'wp_head', 'rel_canonical' ); //rel=canonical remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); //rel=shortlink //remove_action( 'wp_head', 'wp_print_styles', 8 ); //移除后台插件加载css remove_action( 'wp_head', 'print_emoji_detection_script', 7 );//移除emoji载入js remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );//emoji载入js remove_action( 'wp_print_styles', 'print_emoji_styles' );//移除emoji载入css remove_action( 'admin_print_styles', 'print_emoji_styles' ); remove_action( 'wp_head', 'rest_output_link_wp_head', 10 ); remove_action('wp_head','wp_resource_hints',2);//移除dns-prefetch
2021年12月09日
8 阅读
0 评论
0 点赞
2021-10-28
Contact Form 7添加 Google reCAPTCHA以对留言转发身份验证!
注册Google reCaptcha注册地址:https://www.google.com/recaptcha/admin/create(可能需要通过特殊手段进行访问,也可以安装“谷歌访问助手”插件,自行解决)需要在注册时选择 reCaptcha类型,选择reCAPTCHA2版本——勾选“进行人机身份验证”复选框,并将自己的网站域名添加到“域名”中, 比如blog.ruinous.top我们将在注册后获得相应的密钥信息,保存好,稍后将使用 设置 reCaptcha在wprdpress 插件市场安装"Contact Form 7 Captcha"插件设置填好之后,不用进行任何设置,直接点击保存更改在contact form7 表单加入 [cf7sr-simple-recaptcha] 保存设置后,刷新页面就可以看到添加之后的效果了
2021年10月28日
18 阅读
0 评论
0 点赞
1
2
3
4
...
7