WordPress Colibri插件停留在50%上传/备份阶段

9jyewag0  于 2022-12-11  发布在  WordPress
关注(0)|答案(2)|浏览(204)

我尝试在版本6.0上使用Colibri Importer导入主题,但它一直停留在50%。当查看网络选项卡时,我发现从服务器返回了一个500错误,主体为

<p>There has been a critical error on this website.</p><p><a href="https://wordpress.org/support/article/faq-troubleshooting/">Learn more about troubleshooting WordPress.</a></p>

如何修复此错误?请参阅以下内容:D

qni6mghb

qni6mghb1#

我查看了/var/log/apache2/error.log中的服务器端日志(我在Apache上使用DigitalOcean WordPress droplet),发现了更多关于问题所在的详细信息。在这些日志中,靠近底部的是以下内容:

[Fri Jun 10 00:38:59.943725 2022] [php:error] [pid 195718] [client 73.188.75.186:58428] PHP Fatal error:
Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, array given in /var/www/html/wp-content/plugins/colibri-sync/src/Colibri/Sync/Endpoints/Importer.php:181
Stack trace:
#0 (181): trim()
#1 /var/www/html/wp-content/plugins/colibri-sync/src/Colibri/Sync/Endpoints/Importer.php(275): Colibri\\Sync\\Endpoints\\Importer->getColibriUploadPath()
#2 /var/www/html/wp-content/plugins/colibri-sync/src/Colibri/Sync/Endpoints/Importer.php(332): Colibri\\Sync\\Endpoints\\Importer->rename()
#3 [internal function]: Colibri\\Sync\\Endpoints\\Importer->execute_backup_content()
#4 /var/www/html/wp-content/plugins/colibri-sync/src/Colibri/Sync/Endpoints/Importer.php(52): call_user_func()
#5 /var/www/html/wp-content/plugins/colibri-sync/src/Colibri/Sync/Core/Endpoint.php(76): Colibri\\Sync\\Endpoints\\Importer->runStep()
#6 /var/www/html/wp-content/plugins/colibri-sync/src/Colibri/Sync/ColibriSync.php(186): Colibri\\Sync\\Core\\Endpoint->verifyAndExecute()
#7 /var/www/html/wp-content/plugins/colibri-sync/src/Colibri/Sync/ColibriSync.php(151): Colibri\\Sync\\ColibriSync->import()
#8 /var/www/html/wp-includes/class-wp-hook.php(307): Colibri\\Sync\\ColibriSync->execute()
#9 /var/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#10 /var/www/html/wp-includes/plugin.php(476): WP_Hook->do_action()
#11 /var/www/html/wp-admin/admin-ajax.php(187): do_action()
#12 {main}\n  thrown in /var/www/html/wp-content/plugins/colibri-sync/src/Colibri/Sync/Endpoints/Importer.php on line 181, referer: https://blog.tripbee.com/wp-admin/tools.php?page=colibri_sync_tools

我在我的服务器上找到了上面提到的/var/www/html/wp-content/plugins/colibri-sync/src/Colibri/Sync/Endpoints/Importer.php文件,并查看了181行上的getColibriUploadPath函数,问题就出在这里。看起来trim函数应该是一个字符串,但却被赋予了一个数组。为了解决这个问题,我替换了

$rel = trim($rel);

if (is_array($rel)) {
    $rel = trim(implode($rel));
}
elseif (is_string($rel)) {
   $rel = trim($rel);
}

并保存了文件。没有重新启动服务器或其他任何东西,我重新尝试导入,它成功了!希望这有助于任何刚刚更新到WP 6. 0并正在努力让Colibri导入器在该版本上工作的人:)

nukf8bse

nukf8bse2#

尝试用WP 6.1.1(Colibri WP是6.0)做同样的事情,在日志中得到同样的错误。修改了服务器上的Importer.php,但是导入过程卡住了,也是50%。

[05-Dec-2022 19:32:48 UTC] PHP Warning:  Undefined array key "status" in /srv/data/web/vhosts/sitename.com/htdocs/wp-content/plugins/colibri-sync/src/Colibri/Sync/Endpoints/Importer.php on line 65
[05-Dec-2022 19:32:52 UTC] PHP Warning:  Undefined array key "status" in /srv/data/web/vhosts/sitename.com/htdocs/wp-content/plugins/colibri-sync/src/Colibri/Sync/Endpoints/Importer.php on line 136

相关问题