wordpress - 更新到最新的 wordpress 5.0 后,联系 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 行是函数开始的地方。
我已删除公共和清除缓存,但该站点仍未修复。
在同一个文件的第 638 行还有一个空的 __construct。
public function __construct() {
}
我希望有人能尽快帮助我解决这个问题。
解决方案
您可以发布发生错误的第 352 行吗?
推荐阅读
- php - 如何在 codeigniter 4 中使用分页器库使用 ajax 进行分页
- nunjucks - 有条件的在 Nunjucks 宏中不起作用
- javascript - 使用 AJAX 进行数组验证:显示错误消息
- java - 包含依赖项的简单 OSGi 应用程序
- jquery - Cheerio 集合元素没有 innerHTML 属性
- axios - 反应 axios 不提供响应
- kubernetes - Kubernetes:kubeadm init - CGROUPS_PIDS:缺失
- junit5 - Junit5 - ParallelExecutionConfigurationStrategy - 如何?
- python - 通过 pip 安装 PySCIPOpt 不起作用
- opencv - Opencv没有安装?