更新到最新的 wordpress 5.0 后,Contact 7 表单导致我的网站出错
Contact 7 form is causing error in my website afrter updated to the latest wordpress 5.0
我的网站在升级到 5.0 版后丢失了一些样式,我昨天检查网站时收到了一封来自 wordpress 的电子邮件,其中包含此错误,它的结构不正确,并且还缺少样式。
我没有遇到过这个错误,所以当我遇到这个错误时,我尝试删除插件 contact form 7 form 并重新安装它,但问题仍然存在。
这是我从日志中得到的消息
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() {
}
我希望有人能尽快帮助我。
能否post第352行出现错误?
我前往 cPanel 并手动删除 wp-content > 插件中的文件联系表 7,然后我下载了插件并在插件会话中上传了它。
之后我清除了缓存并刷新了我的网站,它又恢复了。
我的网站在升级到 5.0 版后丢失了一些样式,我昨天检查网站时收到了一封来自 wordpress 的电子邮件,其中包含此错误,它的结构不正确,并且还缺少样式。
我没有遇到过这个错误,所以当我遇到这个错误时,我尝试删除插件 contact form 7 form 并重新安装它,但问题仍然存在。
这是我从日志中得到的消息
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() {
}
我希望有人能尽快帮助我。
能否post第352行出现错误?
我前往 cPanel 并手动删除 wp-content > 插件中的文件联系表 7,然后我下载了插件并在插件会话中上传了它。
之后我清除了缓存并刷新了我的网站,它又恢复了。