wordpress - 更新到最新的 wordpress 5.0 后,联系 7 表格导致我的网站出现错误

标签 wordpress logging error-handling contact-form-7

升级到 5.0 版后,我的网站缺少一些样式,昨天我检查网站时收到了一封来自 wordpress 的电子邮件,其中包含此错误,它的结构不正确,也缺少样式。

我没有遇到这个错误,所以当我得到它时,我试图删除插件联系表格 7 表格并重新安装它,但问题仍然存在。

这是我从日志中得到的消息

Error Details
=============
An error of type E_PARSE was caused in line 352 of the file /home/****/public_html/wp-content/plugins/contact-form-7/modules/constant-contact.php. Error message: syntax error, unexpected 'pu' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)

这是有问题的功能
          public function create_contact( $properties ) {
        $endpoint = 'https://api.cc.email/v3/contacts';

        $request = array(
            'method' => 'POST',
            'headers' => array(
                'Accept' => 'application/json',
                'Content-Type' => 'application/json; charset=utf-8',
            ),
            'body' => json_encode( $properties ),
        );

        $response = $this->remote_request( $endpoint, $request );

        if ( 400 <= (int) wp_remote_retrieve_response_code( $response ) ) {
            if ( WP_DEBUG ) {
                $this->log( $endpoint, $request, $response );
            }

            return false;
        }
    }

第 352 行是函数开始的地方。

我已删除公共(public)和清除缓存,但该站点仍未修复。

在同一个文件的第 638 行还有一个空的 __construct。
public function __construct() {
    }


我希望有人能尽快帮助我解决这个问题。

最佳答案

您可以发布发生错误的第 352 行吗?

关于wordpress - 更新到最新的 wordpress 5.0 后,联系 7 表格导致我的网站出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56643010/

相关文章:

python - 用于 Python 应用程序的 Bluemix 日志记录

php - 任何简单的 PHP 解析错误都会导致 500 服务器错误

iphone - Xcode 4.6 错误 - 等待应用程序启动超时

java - Log4j2 回滚后始终写入同一个文件

Perl:如果 IPC::Run 终止,则从进程中检索输出

javascript - 如何编辑单个页面的 css 及其元素(wordpress)?

php - 更改结账页面上 WooCommerce 优惠券的 "Remove"链接文本

php - Woocommerce API PHP 响应 header

php - 如何网站只能从 iframe 访问

java - Logback SMTPAppender 限制速率