wordpress - Wordpress CLI “Warning: Some code is trying to do a URL redirect.” error
问题描述
I'm using WP CLI to manage the cron tasks of my Wordpress installation. Was working well, but now I'm getting the error:
Warning: Some code is trying to do a URL redirect. Backtrace:
#0 WP_CLI\Utils\wp_redirect_handler(https://example.com.br) called at [/home/user/public_html/wp-includes/class-wp-hook.php:289]
#1 WP_Hook->apply_filters(https://example.com.br, Array ([0] => https://example.com.br,[1] => 301)) called at [/home/user/public_html/wp-includes/plugin.php:206]
#2 apply_filters(wp_redirect, https://example.com.br, 301) called at [/home/user/public_html/wp-includes/pluggable.php:1257]
#3 wp_redirect(https://example.com.br, 301) called at [/home/user/public_html/wp-content/plugins/w3-total-cache/PgCache_Plugin.php:214]
#4 W3TC\PgCache_Plugin->redirect_on_foreign_domain() called at [/home/user/public_html/wp-includes/class-wp-hook.php:287]
#5 WP_Hook->apply_filters(, Array ([0] => )) called at [/home/user/public_html/wp-includes/class-wp-hook.php:311]
#6 WP_Hook->do_action(Array ([0] => )) called at [/home/user/public_html/wp-includes/plugin.php:478]
#7 do_action(init) called at [/home/user/public_html/wp-settings.php:546]
#8 require(/home/user/public_html/wp-settings.php) called at [phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1237]
#9 WP_CLI\Runner->load_wordpress() called at [phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1158]
#10 WP_CLI\Runner->start() called at [phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php:23]
#11 WP_CLI\Bootstrap\LaunchRunner->process(WP_CLI\Bootstrap\BootstrapState Object ([WP_CLI\Bootstrap\BootstrapStatestate] => Array ())) called at [phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php:74]
#12 WP_CLI\bootstrap() called at [phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php:27]
#13 include(phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php) called at [phar:///usr/local/bin/wp/php/boot-phar.php:11]
#14 include(phar:///usr/local/bin/wp/php/boot-phar.php) called at [/usr/local/bin/wp:4]
Any tips?
解决方案
谷歌搜索,我意识到问题出在 W3 Total Cache 插件上,并使用了以下选项:
--skip-plugins=w3-total-cache
我现在工作:
wp cron event run --due-now --skip-plugins=w3-total-cache
应该与显示相同错误的任何其他插件一起使用
推荐阅读
- sql - 列出员工使用自我加入的工作分钟数
- javascript - 将图像 Blob 添加到现有数组并更新状态
- firebase - 我可以根据 id 列表获取一组 Firestore 集合中的所有文档吗?
- r - 如何根据 R 中第 2 列的条件找到第 1 列中值的频率?
- javascript - 从 Web 组件继承时如何填充插槽?
- python - 用 BeautifulSoup刮标签
- python - 动态导入模块中的多处理
- unity3d - 网格变换不会相应地转换为 WheelCollider
- swift - 使用 NavigationLink 推送视图时,已发布的 ViewModel 会导致内存泄漏
- java - 如何计算 Java 批处理中捕获的异常数量?