diff options
Diffstat (limited to 'plugins/jetpack/modules/sitemaps/sitemap-builder.php')
-rw-r--r-- | plugins/jetpack/modules/sitemaps/sitemap-builder.php | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/plugins/jetpack/modules/sitemaps/sitemap-builder.php b/plugins/jetpack/modules/sitemaps/sitemap-builder.php index e8719650..7116f1b2 100644 --- a/plugins/jetpack/modules/sitemaps/sitemap-builder.php +++ b/plugins/jetpack/modules/sitemaps/sitemap-builder.php @@ -1,4 +1,4 @@ -<?php +<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Build the sitemap tree. * @@ -38,7 +38,9 @@ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { * Simple class for rendering an empty sitemap with a short TTL */ class Jetpack_Sitemap_Buffer_Empty extends Jetpack_Sitemap_Buffer { - + /** + * Jetpack_Sitemap_Buffer_Empty constructor. + */ public function __construct() { parent::__construct( JP_SITEMAP_MAX_ITEMS, JP_SITEMAP_MAX_BYTES, '1970-01-01 00:00:00' ); @@ -54,6 +56,9 @@ class Jetpack_Sitemap_Buffer_Empty extends Jetpack_Sitemap_Buffer { ); } + /** + * Returns a DOM element for an empty sitemap. + */ protected function get_root_element() { if ( ! isset( $this->root ) ) { $this->root = $this->doc->createElement( 'sitemapindex' ); @@ -74,7 +79,7 @@ class Jetpack_Sitemap_Buffer_Empty extends Jetpack_Sitemap_Buffer { * * @since 4.8.0 */ -class Jetpack_Sitemap_Builder { +class Jetpack_Sitemap_Builder { // phpcs:ignore Generic.Files.OneObjectStructurePerFile.MultipleFound,Generic.Classes.OpeningBraceSameLine.ContentAfterBrace /** * Librarian object for storing and retrieving sitemap data. @@ -613,7 +618,7 @@ class Jetpack_Sitemap_Builder { JP_SITEMAP_BATCH_SIZE ); - if ( null == $posts ) { // WPCS: loose comparison ok. + if ( null == $posts ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual -- WPCS: loose comparison ok. $any_posts_left = false; break; } @@ -700,7 +705,7 @@ class Jetpack_Sitemap_Builder { * @param DOMDocument $doc Data tree for sitemap. * @param string $last_modified Date of last modification. */ - $tree = apply_filters( + $tree = apply_filters( // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable 'jetpack_print_sitemap', $buffer->get_document(), $buffer->last_modified() @@ -763,7 +768,7 @@ class Jetpack_Sitemap_Builder { JP_SITEMAP_BATCH_SIZE ); - if ( null == $posts ) { // WPCS: loose comparison ok. + if ( null == $posts ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual -- WPCS: loose comparison ok. $any_posts_left = false; break; } @@ -842,7 +847,7 @@ class Jetpack_Sitemap_Builder { JP_SITEMAP_BATCH_SIZE ); - if ( null == $posts ) { // WPCS: loose comparison ok. + if ( null == $posts ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual -- WPCS: loose comparison ok. $any_posts_left = false; break; } @@ -950,7 +955,7 @@ class Jetpack_Sitemap_Builder { ); // If there were no posts to get, make a note. - if ( null == $posts ) { // WPCS: loose comparison ok. + if ( null == $posts ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual -- WPCS: loose comparison ok. $any_sitemaps_left = false; break; } @@ -1023,7 +1028,6 @@ class Jetpack_Sitemap_Builder { ); } - /** * This is served instead of a 404 when the master sitemap is requested * but not yet generated. @@ -1224,7 +1228,7 @@ class Jetpack_Sitemap_Builder { } $parent_url = get_permalink( get_post( $post->post_parent ) ); - if ( '' == $parent_url ) { // WPCS: loose comparison ok. + if ( '' == $parent_url ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual -- WPCS: loose comparison ok. $parent_url = get_permalink( $post ); } @@ -1308,7 +1312,7 @@ class Jetpack_Sitemap_Builder { } $parent_url = esc_url( get_permalink( get_post( $post->post_parent ) ) ); - if ( '' == $parent_url ) { // WPCS: loose comparison ok. + if ( '' == $parent_url ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual -- WPCS: loose comparison ok. $parent_url = esc_url( get_permalink( $post ) ); } @@ -1320,7 +1324,7 @@ class Jetpack_Sitemap_Builder { /** This filter is already documented in core/wp-includes/feed.php */ $content = apply_filters( 'the_content_feed', $content, 'rss2' ); - // Include thumbnails for VideoPress videos, use blank image for others + // Include thumbnails for VideoPress videos, use blank image for others. if ( 'complete' === get_post_meta( $post->ID, 'videopress_status', true ) && has_post_thumbnail( $post ) ) { $video_thumbnail_url = get_the_post_thumbnail_url( $post ); } else { |