Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/sitemaps
File: sitemap-buffer-video-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_Video
[4] Fix | Delete
* extends the Jetpack_Sitemap_Buffer class to represent the single video 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 sitemap video 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_Video extends Jetpack_Sitemap_Buffer_Fallback {
[22] Fix | Delete
// @phan-suppress-previous-line UnusedSuppression -- It's used.
[23] Fix | Delete
/**
[24] Fix | Delete
* Returns a DOM element that contains all video sitemap elements.
[25] Fix | Delete
*/
[26] Fix | Delete
protected function get_root_element() {
[27] Fix | Delete
if ( ! isset( $this->root ) ) {
[28] Fix | Delete
[29] Fix | Delete
/**
[30] Fix | Delete
* Filter the XML namespaces included in video sitemaps.
[31] Fix | Delete
*
[32] Fix | Delete
* @module sitemaps
[33] Fix | Delete
*
[34] Fix | Delete
* @since 4.8.0
[35] Fix | Delete
*
[36] Fix | Delete
* @param array $namespaces Associative array with namespaces and namespace URIs.
[37] Fix | Delete
*/
[38] Fix | Delete
$namespaces = apply_filters(
[39] Fix | Delete
'jetpack_sitemap_video_ns',
[40] Fix | Delete
array(
[41] Fix | Delete
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
[42] Fix | Delete
'xsi:schemaLocation' => 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd',
[43] Fix | Delete
'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9',
[44] Fix | Delete
'xmlns:video' => 'http://www.google.com/schemas/sitemap-video/1.1',
[45] Fix | Delete
)
[46] Fix | Delete
);
[47] Fix | Delete
[48] Fix | Delete
$video_sitemap_xsl_url = $this->finder->construct_sitemap_url( 'video-sitemap.xsl' );
[49] Fix | Delete
$jetpack_version = JETPACK__VERSION;
[50] Fix | Delete
[51] Fix | Delete
$this->root = array(
[52] Fix | Delete
"<!-- generator='jetpack-{$jetpack_version}' -->" . PHP_EOL
[53] Fix | Delete
. "<?xml-stylesheet type='text/xsl' href='{$video_sitemap_xsl_url}'?>" . PHP_EOL
[54] Fix | Delete
. '<urlset ' . $this->array_to_xml_attr_string( $namespaces ) . '>',
[55] Fix | Delete
'</urlset>',
[56] Fix | Delete
);
[57] Fix | Delete
[58] Fix | Delete
$this->byte_capacity -= strlen( implode( '', $this->root ) );
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
return $this->root;
[62] Fix | Delete
}
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function