“我爱水煮鱼” 是一款中文比较有名的 WordPress 博客优化插件, 提供了相当多的功能. 我很久之前装了, 后来觉得不好用就卸载了. 谁知插件很霸道, 虽然在 wp-contents/plugins 插件目录下已经把整个文件夹删除了, 插件列表也找不到该插件了, 可是在WP仪表盘上还是能看到 “我爱水煮鱼” 的模块. 这个模块主要就是显示一些文章, 没啥用.
考虑到安全和隐私问题, 果断要进行清理移除干净.
修改(子)主题的 functions.php 文件, 加入以下即可.
1 2 3 4 5 6 7 | //删除 WordPress 后台仪表盘 function disable_dashboard_widgets() { global $wp_meta_boxes; unset($wp_meta_boxes['dashboard']['normal']['core']['wpjam_dashboard_widget']); unset($wp_meta_boxes['dashboard']['normal']['core']['wpjam_dashboard_widget_function']); } add_action('wp_dashboard_setup', 'disable_dashboard_widgets', 999); |
//删除 WordPress 后台仪表盘 function disable_dashboard_widgets() { global $wp_meta_boxes; unset($wp_meta_boxes['dashboard']['normal']['core']['wpjam_dashboard_widget']); unset($wp_meta_boxes['dashboard']['normal']['core']['wpjam_dashboard_widget_function']); } add_action('wp_dashboard_setup', 'disable_dashboard_widgets', 999);
若是要清理仪表盘的其它模块, 可以相应的加入以下代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | //删除 WordPress 后台仪表盘 function disable_dashboard_widgets() { global $wp_meta_boxes; unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); } add_action('wp_dashboard_setup', 'disable_dashboard_widgets', 999); |
//删除 WordPress 后台仪表盘 function disable_dashboard_widgets() { global $wp_meta_boxes; unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); } add_action('wp_dashboard_setup', 'disable_dashboard_widgets', 999);
一下子清爽了很多.
更新: 后来发现在安装了一个回复邮件功能(Comment Reply Notification)插件里 被强行安装的, 代码在 /wp-content/plugins/comment-reply-notification下的那个PHP:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | if(!function_exists('wpjam_modify_dashboard_widgets')){ add_action('wp_dashboard_setup', 'wpjam_modify_dashboard_widgets' ); function wpjam_modify_dashboard_widgets() { global $wp_meta_boxes; if( strpos(WPLANG, 'zh_') === false){ wp_add_dashboard_widget('wpjam_dashboard_widget', 'Theme10', 'wpjam_dashboard_widget_function'); }else{ wp_add_dashboard_widget('wpjam_dashboard_widget', '我爱水煮鱼', 'wpjam_dashboard_widget_function'); } } function wpjam_dashboard_widget_function() { if( strpos(WPLANG, 'zh_') === false){ echo '<div class="rss-widget">'; wp_widget_rss_output('http://theme10.com/feed/', array( 'show_author' => 0, 'show_date' => 1, 'show_summary' => 0 )); echo "</div>"; }else{ ?> <p><a href="http://wpjam.com/&utm_medium=wp-plugin&utm_campaign=wp-plugin&utm_source=<?php bloginfo('home');?>" title="WordPress JAM" target="_blank"><img src="http://wpjam.com/wp-content/themes/WPJ-Parent/images/logo_index_1.png" alt="WordPress JAM"></a><br /> <a href="http://wpjam.com/&utm_medium=wp-plugin&utm_campaign=wp-plugin&utm_source=<?php bloginfo('home');?>" title="WordPress JAM" target="_blank"> WordPress JAM</a> 是中国最好的 WordPress 二次开发团队, 我们精通 WordPress, 可以制作 WordPress 主题, 开发 WordPress 插件, WordPress 整站优化. </p> <hr /> <?php echo '<div class="rss-widget">'; wp_widget_rss_output('http://fairyfish.net/feed/', array( 'show_author' => 0, 'show_date' => 1, 'show_summary' => 0 )); echo "</div>"; } } } |
if(!function_exists('wpjam_modify_dashboard_widgets')){ add_action('wp_dashboard_setup', 'wpjam_modify_dashboard_widgets' ); function wpjam_modify_dashboard_widgets() { global $wp_meta_boxes; if( strpos(WPLANG, 'zh_') === false){ wp_add_dashboard_widget('wpjam_dashboard_widget', 'Theme10', 'wpjam_dashboard_widget_function'); }else{ wp_add_dashboard_widget('wpjam_dashboard_widget', '我爱水煮鱼', 'wpjam_dashboard_widget_function'); } } function wpjam_dashboard_widget_function() { if( strpos(WPLANG, 'zh_') === false){ echo '<div class="rss-widget">'; wp_widget_rss_output('http://theme10.com/feed/', array( 'show_author' => 0, 'show_date' => 1, 'show_summary' => 0 )); echo "</div>"; }else{ ?> <p><a href="http://wpjam.com/&utm_medium=wp-plugin&utm_campaign=wp-plugin&utm_source=<?php bloginfo('home');?>" title="WordPress JAM" target="_blank"><img src="http://wpjam.com/wp-content/themes/WPJ-Parent/images/logo_index_1.png" alt="WordPress JAM"></a><br /> <a href="http://wpjam.com/&utm_medium=wp-plugin&utm_campaign=wp-plugin&utm_source=<?php bloginfo('home');?>" title="WordPress JAM" target="_blank"> WordPress JAM</a> 是中国最好的 WordPress 二次开发团队, 我们精通 WordPress, 可以制作 WordPress 主题, 开发 WordPress 插件, WordPress 整站优化. </p> <hr /> <?php echo '<div class="rss-widget">'; wp_widget_rss_output('http://fairyfish.net/feed/', array( 'show_author' => 0, 'show_date' => 1, 'show_summary' => 0 )); echo "</div>"; } } }
防不胜防啊. 为了点流量 偷偷插入, 而且不给用户选择的权利, 这吃香有点难看.
GD Star Rating
loading...
本文一共 320 个汉字, 你数一下对不对.loading...
上一篇: 在树莓派上通过Python脚本来查看CPU的温度
下一篇: 如何通过 CloudFlare App给网站加上 反 Ads Blocker 广告插件?
扫描二维码,分享本文到微信朋友圈
应该是当年水煮鱼功力不够, 该往卸载钩子里加的东西没有加.
哦哦, 那情有可原