无法确定请求文件的原因

Unable to identfy why file is being requested

您好,我正在网站上工作并使用 chrome 中的开发人员工具,我看到请求文件 undefined?1428992352055 请求我的服务器 returns 一个 404。我无法确定请求此文件的原因或位置。 它也不会在您每次加载页面时发生,通常是在重新加载时发生。下面是 headers,我认为这是所有需要的,但我已经搜索了又搜索,无法弄清楚这个文件发生了什么。任何建议表示赞赏。

没有进行缓存,我在整个服务器中搜索了这个字符串,希望删除对它的引用。我已经在互联网上搜索了这个问题,但无法找出是什么原因造成的。

Remote Address:216.172.182.170:80
Request URL:http://example.com/undefined?1428992352055
Request Method:GET
Status Code:404 Not Found
Response Headers
view source
Cache-Control:no-cache, must-revalidate, max-age=0
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:4910
Content-Type:text/html; charset=UTF-8
Date:Tue, 14 Apr 2015 06:19:14 GMT
Expires:Wed, 11 Jan 1984 05:00:00 GMT
Keep-Alive:timeout=5, max=91
Pragma:no-cache
Server:Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips DAV/2 mod_bwlimited/1.4
Vary:Accept-Encoding,User-Agent
X-Pingback:http://example.com/xmlrpc.php
X-Powered-By:PHP/5.4.39
Request Headers
view source
Accept:image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Cookie:__utma=41034800.1981457984.1428284260.1428541875.1428547896.5; __utmc=41034800; __utmz=41034800.1428547896.5.3.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=http%3A%2F%2Fwww..com%2Ftestimonials; word; _ga=GA1.2.1981457984.1428284260; PHPSESSID=4c6d6e257019f77756205ce29170d54e; wp-settings-1=libraryContent%3Dbrowse%26editor%3Dtinymce%26wplink%3D1%26urlbutton%3Dnone%26imgsize%3Dfull%26advImgDetails%3Dshow%26hidetb%3D1%26posts_list_mode%3Dlist%26post_dfw%3Doff%26mfold%3Do%26align%3Dleft; wp-settings-time-1=1428991051
Host:.com
Pragma:no-cache
Referer:http://.com/
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36
Query String Parameters
view source
view URL encoded
1428992352055:

在阅读我的 post 以确保没有太多错误时,这句话让我印象深刻。 X-Pingback:http://example.com/xmlrpc.php 所以我去了服务器,这是该文件中可能是罪魁祸首的内容。

<?php
/**
 * XML-RPC protocol support for WordPress
 *
 * @package WordPress
 */

/**
 * Whether this is an XML-RPC Request
 *
 * @var bool
 */
define('XMLRPC_REQUEST', true);

// Some browser-embedded clients send cookies. We don't want them.
$_COOKIE = array();

// A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default,
// but we can do it ourself.
if ( !isset( $HTTP_RAW_POST_DATA ) ) {
    $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' );
}

// fix for mozBlog and other cases where '<?xml' isn't on the very first line
if ( isset($HTTP_RAW_POST_DATA) )
    $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);

/** Include the bootstrap for setting up WordPress environment */
include('./wp-load.php');

if ( isset( $_GET['rsd'] ) ) { // http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
?>
<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
  <service>
    <engineName>WordPress</engineName>
    <engineLink>http://wordpress.org/</engineLink>
    <homePageLink><?php bloginfo_rss('url') ?></homePageLink>
    <apis>
      <api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
      <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
      <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
      <api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
      <?php
      /**
       * Add additional APIs to the Really Simple Discovery (RSD) endpoint.
       *
       * @link http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html
       *
       * @since 3.5.0
       */
      do_action( 'xmlrpc_rsd_apis' );
      ?>
    </apis>
  </service>
</rsd>
<?php
exit;
}

include_once(ABSPATH . 'wp-admin/includes/admin.php');
include_once(ABSPATH . WPINC . '/class-IXR.php');
include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');

/**
 * Posts submitted via the XML-RPC interface get that title
 * @name post_default_title
 * @var string
 */
$post_default_title = "";

/**
 * Filter the class used for handling XML-RPC requests.
 *
 * @since 3.1.0
 *
 * @param string $class The name of the XML-RPC server class.
 */
$wp_xmlrpc_server_class = apply_filters( 'wp_xmlrpc_server_class', 'wp_xmlrpc_server' );
$wp_xmlrpc_server = new $wp_xmlrpc_server_class;

// Fire off the request
$wp_xmlrpc_server->serve_request();

exit;

/**
 * logIO() - Writes logging info to a file.
 *
 * @deprecated 3.4.0
 * @deprecated Use error_log()
 *
 * @param string $io Whether input or output
 * @param string $msg Information describing logging reason.
 */
function logIO( $io, $msg ) {
    _deprecated_function( __FUNCTION__, '3.4', 'error_log()' );
    if ( ! empty( $GLOBALS['xmlrpc_logging'] ) )
        error_log( $io . ' - ' . $msg );
}

我尝试重新加载它几次,但没有收到任何错误。如果您认为 xml-rpc 是罪魁祸首,那么只需将其从 header 中删除即可。如果您不使用任何远程发布功能,那么删除它总是好的,因为它会导致安全问题。要删除它,只需将其包含在您的函数文件中

function remove_x_pingback($headers) {
    unset($headers['X-Pingback']);
    return $headers;
}
add_filter('wp_headers', 'remove_x_pingback');