Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/sitemaps
File: sitemap-buffer-master-fallback.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 for users without libxml support.
[17] Fix | Delete
*
[18] Fix | Delete
* @since 5.3.0
[19] Fix | Delete
* @phan-suppress PhanRedefinedClassReference -- Don't conflict with real version.
[20] Fix | Delete
*/
[21] Fix | Delete
class Jetpack_Sitemap_Buffer_Master extends Jetpack_Sitemap_Buffer_Fallback {
[22] Fix | Delete
// @phan-suppress-previous-line UnusedSuppression -- It's used.
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* Returns a DOM element that contains all master sitemap elements.
[26] Fix | Delete
*/
[27] Fix | Delete
protected function get_root_element() {
[28] Fix | Delete
[29] Fix | Delete
if ( ! isset( $this->root ) ) {
[30] Fix | Delete
[31] Fix | Delete
$sitemap_index_xsl_url = $this->finder->construct_sitemap_url( 'sitemap-index.xsl' );
[32] Fix | Delete
$jetpack_version = JETPACK__VERSION;
[33] Fix | Delete
[34] Fix | Delete
$this->root = array(
[35] Fix | Delete
"<!-- generator='jetpack-{$jetpack_version}' -->" . PHP_EOL
[36] Fix | Delete
. "<?xml-stylesheet type='text/xsl' href='{$sitemap_index_xsl_url}'?>" . PHP_EOL
[37] Fix | Delete
. "<sitemapindex xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>" . PHP_EOL,
[38] Fix | Delete
'</sitemapindex>',
[39] Fix | Delete
);
[40] Fix | Delete
[41] Fix | Delete
$this->byte_capacity -= strlen( implode( '', $this->root ) );
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
return $this->root;
[45] Fix | Delete
}
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function