Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/sitemaps
File: sitemap-buffer-master.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
[0] Fix | Delete
// phpcs:disable Generic.Classes.DuplicateClassName.Found -- sitemap-builder.php will require correct class file.
[1] Fix | Delete
/**
[2] Fix | Delete
* Sitemaps (per the protocol) are essentially lists of XML fragments;
[3] Fix | Delete
* lists which are subject to size constraints. The Jetpack_Sitemap_Buffer_Master
[4] Fix | Delete
* extends the Jetpack_Sitemap_Buffer class to represent the master sitemap
[5] Fix | Delete
* buffer.
[6] Fix | Delete
*
[7] Fix | Delete
* @since 5.3.0
[8] Fix | Delete
* @package automattic/jetpack
[9] Fix | Delete
*/
[10] Fix | Delete
[11] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[12] Fix | Delete
exit( 0 );
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* A buffer for constructing master sitemap xml files.
[17] Fix | Delete
*
[18] Fix | Delete
* @since 5.3.0
[19] Fix | Delete
*/
[20] Fix | Delete
class Jetpack_Sitemap_Buffer_Master extends Jetpack_Sitemap_Buffer {
[21] Fix | Delete
/**
[22] Fix | Delete
* Jetpack_Sitemap_Buffer_Master constructor.
[23] Fix | Delete
*
[24] Fix | Delete
* @param int $item_limit The maximum size of the buffer in items.
[25] Fix | Delete
* @param int $byte_limit The maximum size of the buffer in bytes.
[26] Fix | Delete
* @param string $time The initial datetime of the buffer. Must be in 'YYYY-MM-DD hh:mm:ss' format.
[27] Fix | Delete
*/
[28] Fix | Delete
public function __construct( $item_limit, $byte_limit, $time = '1970-01-01 00:00:00' ) {
[29] Fix | Delete
parent::__construct( $item_limit, $byte_limit, $time );
[30] Fix | Delete
[31] Fix | Delete
$this->doc->appendChild(
[32] Fix | Delete
$this->doc->createComment( "generator='jetpack-" . JETPACK__VERSION . "'" )
[33] Fix | Delete
);
[34] Fix | Delete
[35] Fix | Delete
$this->doc->appendChild(
[36] Fix | Delete
$this->doc->createComment( 'Jetpack_Sitemap_Buffer_Master' )
[37] Fix | Delete
);
[38] Fix | Delete
[39] Fix | Delete
$this->doc->appendChild(
[40] Fix | Delete
$this->doc->createProcessingInstruction(
[41] Fix | Delete
'xml-stylesheet',
[42] Fix | Delete
'type="text/xsl" href="' . $this->finder->construct_sitemap_url( 'sitemap-index.xsl' ) . '"'
[43] Fix | Delete
)
[44] Fix | Delete
);
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
/**
[48] Fix | Delete
* Returns a DOM element that contains all master sitemap elements.
[49] Fix | Delete
*/
[50] Fix | Delete
protected function get_root_element() {
[51] Fix | Delete
if ( ! isset( $this->root ) ) {
[52] Fix | Delete
$this->root = $this->doc->createElement( 'sitemapindex' );
[53] Fix | Delete
$this->root->setAttribute( 'xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9' );
[54] Fix | Delete
$this->doc->appendChild( $this->root );
[55] Fix | Delete
$this->byte_capacity -= strlen( $this->doc->saveXML( $this->root ) );
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
return $this->root;
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function