zoukankan      html  css  js  c++  java
  • wordpress报 [REQ_ERR: 403] [KTrafficClient] Something is wrong. Enable debug mode to see the reason.错误 ,修改方法

    wordpress主题开发 一单出现这种错误:

    [REQ_ERR: 403] [KTrafficClient] Something is wrong. Enable debug mode to see the reason.

    就意味着你的主体后台更新了,第一步就是先禁用WP的后台自动升级

    1. 禁用后台自动更新代码

    /** 关闭WordPress自动更新升级 */
    define('AUTOMATIC_UPDATER_DISABLED', true);
    

    2.打开wordpress根目录 找到 Kclient.php 文件 修改如下:

      public function performRequest()
        {
            if ($this->_result) {
                return $this->_result;
            }
            $request = $this->_buildRequestUrl();
            $params = $this->getParams();
            $options = $this->_getRequestOptions();
            $this->log('Request: ' . $request);
            try {
                $result = $this->_httpClient->request($request, $params, $options);
                $this->log('Response: ' . $result);
            } catch (KClientError $e) {
                if ($this->_debug) {
                    throw $e;
                } else {
                    $errorCode = $e->getHumanCode();
                    $errorCode = $errorCode ? $errorCode . ' ' : '';
    
                    // echo $errorCode . self::ERROR;    //问题所在就在这一行,只需要注释掉 就不会报错了
                    return;
                }
            }
            $this->_result = json_decode($result);
            $this->_storeState(
                $this->_result,
                isset($this->_result->cookies_ttl) ? $this->_result->cookies_ttl : null
            );
    
            if (isset($this->_result->cookies)) {
                $this->_saveKeitaroCookies($this->_result->cookies, $this->_result->cookies_ttl);
            }
            return $this->_result;
        }
    

      

  • 相关阅读:
    css 背景透明 适合所有浏览器
    Razor中Html.DropDownListFor用法
    outlook2010如何初始化设置
    移除文件关联
    MVC中的Html.ActionLink的介绍(转)
    DES可逆加解密
    Razor视图下服务器代码给Javascript变量赋值
    js获取url参数值
    python 3 简单线程、数据库操、Mssql访问示例
    ps快捷键
  • 原文地址:https://www.cnblogs.com/web928943/p/14980215.html
Copyright © 2011-2022 走看看