WordPress在安装插件后损坏


WordPress corrupt after installing plugin

我安装了这个插件https://wordpress.org/plugins/wp-gallery-custom-links/在安装过程中遇到一个错误,在刷新页面之前我没有时间阅读。

现在我的媒体选择器根本没有加载。

我完全删除了插件,但没有运气,现在我甚至无法再联系到wp管理员。获取错误,如:

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxx.com/httpdocs/wp-includes/pluggable.php on line 1196
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxx.com/httpdocs/wp-login.php on line 425
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxx.com/httpdocs/wp-login.php on line 438
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxxx.com/httpdocs/wp-login.php on line 425
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxxx.com/httpdocs/wp-login.php on line 438
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/caroli.hosterspace.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxxxx.com/httpdocs/wp-includes/pluggable.php on line 925
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxxxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxx.com/httpdocs/wp-includes/pluggable.php on line 926
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxxx.com/httpdocs/wp-includes/pluggable.php on line 927
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/xxxxxxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1) in /var/www/vhosts/xxxxxx.com/httpdocs/wp-includes/pluggable.php on line 1196

我下载了wordpress的新副本,并替换了wp-admin文件夹、wp-includs文件夹、wp-config.php文件、wp-login.php文件。

我尝试过更改插件文件夹上的名称,但仍然不起作用,我尝试过删除我的主题以访问wp管理员,但仍然没有起作用。

我怀疑这可能是数据库,但我没能找到问题。。有人能帮忙吗?

我已经多次遇到这个问题,正如Vaviloff所说,在文件的开头(<?php之前)放置一个空格是您想要的

一些可能的原因:

  • 损坏的插件
  • 腐朽的主题
  • Wordpress安装中的入侵(您会在文件的开头看到一些eval())

可能的解决方案:

  • 检查相关文件:/var/www/vhosts/xxxx.com/httpdocs/wp-content/themes/caolli/functions.php:1并移除<?php之前的空间
  • 禁用你安装的最新插件,看看它是否有任何作用
  • 运行像Wordfence这样的插件(以防万一),它会扫描你的文件比手动更快,并使用WP core检查差异或查找可疑代码(免费版本可以完成所有这些)

编辑:我刚刚看到你无法联系到wp管理员。这很棘手,但我也遇到过同样的问题。嗯,这是一次入侵(由于一个过时的插件)

我做了什么?

  • 我主题的备份
  • 我数据库的备份
  • 我上传的备份
  • 已安装插件的列表
  • 更改了所有密码
  • 删除了服务器的所有相关部分(在所有备份之后)
  • 重新安装新WP
  • 恢复的主题/DB/uploads/plugins(安装插件时检查插件的最后更新)
  • 已安装Wordfence,以防万一

Cannot modify header information - headers already sent by

意味着在到达脚本末尾之前,某些文件中已经有一些文本发送到浏览器。

output started at /var/www/vhosts/xxxx.com/httpdocs/wp-content/themes/caroli/functions.php:1

检查该文件,在<?php代码开始声明之前,文件的开头可能有一个空格。

我在文件的开头没有空格,可能罪魁祸首是UTF BOM,你应该在文本编辑器的帮助下删除它,例如Notepad++可以选择这样做(编码->转换为UTF-8)。