Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wordpres.../inc/sitemaps
File: class-sitemaps.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WPSEO plugin file.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WPSEO\XML_Sitemaps
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Class WPSEO_Sitemaps.
[8] Fix | Delete
*
[9] Fix | Delete
* @todo This class could use a general description with some explanation on sitemaps. OR.
[10] Fix | Delete
*/
[11] Fix | Delete
class WPSEO_Sitemaps {
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Sitemap index identifier.
[15] Fix | Delete
*
[16] Fix | Delete
* @var string
[17] Fix | Delete
*/
[18] Fix | Delete
public const SITEMAP_INDEX_TYPE = '1';
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* Content of the sitemap to output.
[22] Fix | Delete
*
[23] Fix | Delete
* @var string
[24] Fix | Delete
*/
[25] Fix | Delete
protected $sitemap = '';
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* Flag to indicate if this is an invalid or empty sitemap.
[29] Fix | Delete
*
[30] Fix | Delete
* @var bool
[31] Fix | Delete
*/
[32] Fix | Delete
public $bad_sitemap = false;
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* Whether or not the XML sitemap was served from a transient or not.
[36] Fix | Delete
*
[37] Fix | Delete
* @var bool
[38] Fix | Delete
*/
[39] Fix | Delete
private $transient = false;
[40] Fix | Delete
[41] Fix | Delete
/**
[42] Fix | Delete
* HTTP protocol to use in headers.
[43] Fix | Delete
*
[44] Fix | Delete
* @since 3.2
[45] Fix | Delete
*
[46] Fix | Delete
* @var string
[47] Fix | Delete
*/
[48] Fix | Delete
protected $http_protocol = 'HTTP/1.1';
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* Holds the n variable.
[52] Fix | Delete
*
[53] Fix | Delete
* @var int
[54] Fix | Delete
*/
[55] Fix | Delete
private $current_page = 1;
[56] Fix | Delete
[57] Fix | Delete
/**
[58] Fix | Delete
* The sitemaps router.
[59] Fix | Delete
*
[60] Fix | Delete
* @since 3.2
[61] Fix | Delete
*
[62] Fix | Delete
* @var WPSEO_Sitemaps_Router
[63] Fix | Delete
*/
[64] Fix | Delete
public $router;
[65] Fix | Delete
[66] Fix | Delete
/**
[67] Fix | Delete
* The sitemap renderer.
[68] Fix | Delete
*
[69] Fix | Delete
* @since 3.2
[70] Fix | Delete
*
[71] Fix | Delete
* @var WPSEO_Sitemaps_Renderer
[72] Fix | Delete
*/
[73] Fix | Delete
public $renderer;
[74] Fix | Delete
[75] Fix | Delete
/**
[76] Fix | Delete
* The sitemap cache.
[77] Fix | Delete
*
[78] Fix | Delete
* @since 3.2
[79] Fix | Delete
*
[80] Fix | Delete
* @var WPSEO_Sitemaps_Cache
[81] Fix | Delete
*/
[82] Fix | Delete
public $cache;
[83] Fix | Delete
[84] Fix | Delete
/**
[85] Fix | Delete
* The sitemap providers.
[86] Fix | Delete
*
[87] Fix | Delete
* @since 3.2
[88] Fix | Delete
*
[89] Fix | Delete
* @var WPSEO_Sitemap_Provider[]
[90] Fix | Delete
*/
[91] Fix | Delete
public $providers;
[92] Fix | Delete
[93] Fix | Delete
/**
[94] Fix | Delete
* Class constructor.
[95] Fix | Delete
*/
[96] Fix | Delete
public function __construct() {
[97] Fix | Delete
[98] Fix | Delete
add_action( 'after_setup_theme', [ $this, 'init_sitemaps_providers' ] );
[99] Fix | Delete
add_action( 'after_setup_theme', [ $this, 'reduce_query_load' ], 99 );
[100] Fix | Delete
add_action( 'pre_get_posts', [ $this, 'redirect' ], 1 );
[101] Fix | Delete
add_action( 'wpseo_hit_sitemap_index', [ $this, 'hit_sitemap_index' ] );
[102] Fix | Delete
[103] Fix | Delete
$this->router = new WPSEO_Sitemaps_Router();
[104] Fix | Delete
$this->renderer = new WPSEO_Sitemaps_Renderer();
[105] Fix | Delete
$this->cache = new WPSEO_Sitemaps_Cache();
[106] Fix | Delete
[107] Fix | Delete
if ( ! empty( $_SERVER['SERVER_PROTOCOL'] ) ) {
[108] Fix | Delete
$this->http_protocol = sanitize_text_field( wp_unslash( $_SERVER['SERVER_PROTOCOL'] ) );
[109] Fix | Delete
}
[110] Fix | Delete
}
[111] Fix | Delete
[112] Fix | Delete
/**
[113] Fix | Delete
* Initialize sitemap providers classes.
[114] Fix | Delete
*
[115] Fix | Delete
* @since 5.3
[116] Fix | Delete
*
[117] Fix | Delete
* @return void
[118] Fix | Delete
*/
[119] Fix | Delete
public function init_sitemaps_providers() {
[120] Fix | Delete
[121] Fix | Delete
$this->providers = [
[122] Fix | Delete
new WPSEO_Post_Type_Sitemap_Provider(),
[123] Fix | Delete
new WPSEO_Taxonomy_Sitemap_Provider(),
[124] Fix | Delete
new WPSEO_Author_Sitemap_Provider(),
[125] Fix | Delete
];
[126] Fix | Delete
[127] Fix | Delete
$external_providers = apply_filters( 'wpseo_sitemaps_providers', [] );
[128] Fix | Delete
[129] Fix | Delete
foreach ( $external_providers as $provider ) {
[130] Fix | Delete
if ( is_object( $provider ) && $provider instanceof WPSEO_Sitemap_Provider ) {
[131] Fix | Delete
$this->providers[] = $provider;
[132] Fix | Delete
}
[133] Fix | Delete
}
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
/**
[137] Fix | Delete
* Check the current request URI, if we can determine it's probably an XML sitemap, kill loading the widgets.
[138] Fix | Delete
*
[139] Fix | Delete
* @return void
[140] Fix | Delete
*/
[141] Fix | Delete
public function reduce_query_load() {
[142] Fix | Delete
if ( ! isset( $_SERVER['REQUEST_URI'] ) ) {
[143] Fix | Delete
return;
[144] Fix | Delete
}
[145] Fix | Delete
$request_uri = sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) );
[146] Fix | Delete
$extension = substr( $request_uri, -4 );
[147] Fix | Delete
if ( stripos( $request_uri, 'sitemap' ) !== false && in_array( $extension, [ '.xml', '.xsl' ], true ) ) {
[148] Fix | Delete
remove_all_actions( 'widgets_init' );
[149] Fix | Delete
}
[150] Fix | Delete
}
[151] Fix | Delete
[152] Fix | Delete
/**
[153] Fix | Delete
* Register your own sitemap. Call this during 'init'.
[154] Fix | Delete
*
[155] Fix | Delete
* @param string $name The name of the sitemap.
[156] Fix | Delete
* @param callback $building_function Function to build your sitemap.
[157] Fix | Delete
* @param string $rewrite Optional. Regular expression to match your sitemap with.
[158] Fix | Delete
*
[159] Fix | Delete
* @return void
[160] Fix | Delete
*/
[161] Fix | Delete
public function register_sitemap( $name, $building_function, $rewrite = '' ) {
[162] Fix | Delete
add_action( 'wpseo_do_sitemap_' . $name, $building_function );
[163] Fix | Delete
if ( $rewrite ) {
[164] Fix | Delete
Yoast_Dynamic_Rewrites::instance()->add_rule( $rewrite, 'index.php?sitemap=' . $name, 'top' );
[165] Fix | Delete
}
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
/**
[169] Fix | Delete
* Register your own XSL file. Call this during 'init'.
[170] Fix | Delete
*
[171] Fix | Delete
* @since 1.4.23
[172] Fix | Delete
*
[173] Fix | Delete
* @param string $name The name of the XSL file.
[174] Fix | Delete
* @param callback $building_function Function to build your XSL file.
[175] Fix | Delete
* @param string $rewrite Optional. Regular expression to match your sitemap with.
[176] Fix | Delete
*
[177] Fix | Delete
* @return void
[178] Fix | Delete
*/
[179] Fix | Delete
public function register_xsl( $name, $building_function, $rewrite = '' ) {
[180] Fix | Delete
add_action( 'wpseo_xsl_' . $name, $building_function );
[181] Fix | Delete
if ( $rewrite ) {
[182] Fix | Delete
Yoast_Dynamic_Rewrites::instance()->add_rule( $rewrite, 'index.php?yoast-sitemap-xsl=' . $name, 'top' );
[183] Fix | Delete
}
[184] Fix | Delete
}
[185] Fix | Delete
[186] Fix | Delete
/**
[187] Fix | Delete
* Set the sitemap current page to allow creating partial sitemaps with WP-CLI
[188] Fix | Delete
* in a one-off process.
[189] Fix | Delete
*
[190] Fix | Delete
* @param int $current_page The part that should be generated.
[191] Fix | Delete
*
[192] Fix | Delete
* @return void
[193] Fix | Delete
*/
[194] Fix | Delete
public function set_n( $current_page ) {
[195] Fix | Delete
if ( is_scalar( $current_page ) && intval( $current_page ) > 0 ) {
[196] Fix | Delete
$this->current_page = intval( $current_page );
[197] Fix | Delete
}
[198] Fix | Delete
}
[199] Fix | Delete
[200] Fix | Delete
/**
[201] Fix | Delete
* Set the sitemap content to display after you have generated it.
[202] Fix | Delete
*
[203] Fix | Delete
* @param string $sitemap The generated sitemap to output.
[204] Fix | Delete
*
[205] Fix | Delete
* @return void
[206] Fix | Delete
*/
[207] Fix | Delete
public function set_sitemap( $sitemap ) {
[208] Fix | Delete
$this->sitemap = $sitemap;
[209] Fix | Delete
}
[210] Fix | Delete
[211] Fix | Delete
/**
[212] Fix | Delete
* Set as true to make the request 404. Used stop the display of empty sitemaps or invalid requests.
[213] Fix | Delete
*
[214] Fix | Delete
* @param bool $is_bad Is this a bad request. True or false.
[215] Fix | Delete
*
[216] Fix | Delete
* @return void
[217] Fix | Delete
*/
[218] Fix | Delete
public function set_bad_sitemap( $is_bad ) {
[219] Fix | Delete
$this->bad_sitemap = (bool) $is_bad;
[220] Fix | Delete
}
[221] Fix | Delete
[222] Fix | Delete
/**
[223] Fix | Delete
* Prevent stupid plugins from running shutdown scripts when we're obviously not outputting HTML.
[224] Fix | Delete
*
[225] Fix | Delete
* @since 1.4.16
[226] Fix | Delete
*
[227] Fix | Delete
* @return void
[228] Fix | Delete
*/
[229] Fix | Delete
public function sitemap_close() {
[230] Fix | Delete
remove_all_actions( 'wp_footer' );
[231] Fix | Delete
die();
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
/**
[235] Fix | Delete
* Hijack requests for potential sitemaps and XSL files.
[236] Fix | Delete
*
[237] Fix | Delete
* @param WP_Query $query Main query instance.
[238] Fix | Delete
*
[239] Fix | Delete
* @return void
[240] Fix | Delete
*/
[241] Fix | Delete
public function redirect( $query ) {
[242] Fix | Delete
[243] Fix | Delete
if ( ! $query->is_main_query() ) {
[244] Fix | Delete
return;
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
$yoast_sitemap_xsl = get_query_var( 'yoast-sitemap-xsl' );
[248] Fix | Delete
[249] Fix | Delete
if ( ! empty( $yoast_sitemap_xsl ) ) {
[250] Fix | Delete
/*
[251] Fix | Delete
* This is a method to provide the XSL via the home_url.
[252] Fix | Delete
* Needed when the site_url and home_url are not the same.
[253] Fix | Delete
* Loading the XSL needs to come from the same domain, protocol and port as the XML.
[254] Fix | Delete
*
[255] Fix | Delete
* Whenever home_url and site_url are the same, the file can be loaded directly.
[256] Fix | Delete
*/
[257] Fix | Delete
$this->xsl_output( $yoast_sitemap_xsl );
[258] Fix | Delete
$this->sitemap_close();
[259] Fix | Delete
[260] Fix | Delete
return;
[261] Fix | Delete
}
[262] Fix | Delete
[263] Fix | Delete
$type = get_query_var( 'sitemap' );
[264] Fix | Delete
[265] Fix | Delete
if ( empty( $type ) ) {
[266] Fix | Delete
return;
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
if ( get_query_var( 'sitemap_n' ) === '1' || get_query_var( 'sitemap_n' ) === '0' ) {
[270] Fix | Delete
wp_safe_redirect( home_url( "/$type-sitemap.xml" ), 301, 'Yoast SEO' );
[271] Fix | Delete
exit;
[272] Fix | Delete
}
[273] Fix | Delete
[274] Fix | Delete
$this->set_n( get_query_var( 'sitemap_n' ) );
[275] Fix | Delete
[276] Fix | Delete
if ( ! $this->get_sitemap_from_cache( $type, $this->current_page ) ) {
[277] Fix | Delete
$this->build_sitemap( $type );
[278] Fix | Delete
}
[279] Fix | Delete
[280] Fix | Delete
if ( $this->bad_sitemap ) {
[281] Fix | Delete
$query->set_404();
[282] Fix | Delete
status_header( 404 );
[283] Fix | Delete
[284] Fix | Delete
return;
[285] Fix | Delete
}
[286] Fix | Delete
[287] Fix | Delete
$this->output();
[288] Fix | Delete
$this->sitemap_close();
[289] Fix | Delete
}
[290] Fix | Delete
[291] Fix | Delete
/**
[292] Fix | Delete
* Try to get the sitemap from cache.
[293] Fix | Delete
*
[294] Fix | Delete
* @param string $type Sitemap type.
[295] Fix | Delete
* @param int $page_number The page number to retrieve.
[296] Fix | Delete
*
[297] Fix | Delete
* @return bool If the sitemap has been retrieved from cache.
[298] Fix | Delete
*/
[299] Fix | Delete
private function get_sitemap_from_cache( $type, $page_number ) {
[300] Fix | Delete
[301] Fix | Delete
$this->transient = false;
[302] Fix | Delete
[303] Fix | Delete
if ( $this->cache->is_enabled() !== true ) {
[304] Fix | Delete
return false;
[305] Fix | Delete
}
[306] Fix | Delete
[307] Fix | Delete
/**
[308] Fix | Delete
* Fires before the attempt to retrieve XML sitemap from the transient cache.
[309] Fix | Delete
*
[310] Fix | Delete
* @param WPSEO_Sitemaps $sitemaps Sitemaps object.
[311] Fix | Delete
*/
[312] Fix | Delete
do_action( 'wpseo_sitemap_stylesheet_cache_' . $type, $this );
[313] Fix | Delete
[314] Fix | Delete
$sitemap_cache_data = $this->cache->get_sitemap_data( $type, $page_number );
[315] Fix | Delete
[316] Fix | Delete
// No cache was found, refresh it because cache is enabled.
[317] Fix | Delete
if ( empty( $sitemap_cache_data ) ) {
[318] Fix | Delete
return $this->refresh_sitemap_cache( $type, $page_number );
[319] Fix | Delete
}
[320] Fix | Delete
[321] Fix | Delete
// Cache object was found, parse information.
[322] Fix | Delete
$this->transient = true;
[323] Fix | Delete
[324] Fix | Delete
$this->sitemap = $sitemap_cache_data->get_sitemap();
[325] Fix | Delete
$this->bad_sitemap = ! $sitemap_cache_data->is_usable();
[326] Fix | Delete
[327] Fix | Delete
return true;
[328] Fix | Delete
}
[329] Fix | Delete
[330] Fix | Delete
/**
[331] Fix | Delete
* Build and save sitemap to cache.
[332] Fix | Delete
*
[333] Fix | Delete
* @param string $type Sitemap type.
[334] Fix | Delete
* @param int $page_number The page number to save to.
[335] Fix | Delete
*
[336] Fix | Delete
* @return bool
[337] Fix | Delete
*/
[338] Fix | Delete
private function refresh_sitemap_cache( $type, $page_number ) {
[339] Fix | Delete
$this->set_n( $page_number );
[340] Fix | Delete
$this->build_sitemap( $type );
[341] Fix | Delete
[342] Fix | Delete
return $this->cache->store_sitemap( $type, $page_number, $this->sitemap, ! $this->bad_sitemap );
[343] Fix | Delete
}
[344] Fix | Delete
[345] Fix | Delete
/**
[346] Fix | Delete
* Attempts to build the requested sitemap.
[347] Fix | Delete
*
[348] Fix | Delete
* Sets $bad_sitemap if this isn't for the root sitemap, a post type or taxonomy.
[349] Fix | Delete
*
[350] Fix | Delete
* @param string $type The requested sitemap's identifier.
[351] Fix | Delete
*
[352] Fix | Delete
* @return void
[353] Fix | Delete
*/
[354] Fix | Delete
public function build_sitemap( $type ) {
[355] Fix | Delete
[356] Fix | Delete
/**
[357] Fix | Delete
* Filter the type of sitemap to build.
[358] Fix | Delete
*
[359] Fix | Delete
* @param string $type Sitemap type, determined by the request.
[360] Fix | Delete
*/
[361] Fix | Delete
$type = apply_filters( 'wpseo_build_sitemap_post_type', $type );
[362] Fix | Delete
[363] Fix | Delete
if ( $type === '1' ) {
[364] Fix | Delete
$this->build_root_map();
[365] Fix | Delete
[366] Fix | Delete
return;
[367] Fix | Delete
}
[368] Fix | Delete
[369] Fix | Delete
$entries_per_page = $this->get_entries_per_page();
[370] Fix | Delete
[371] Fix | Delete
foreach ( $this->providers as $provider ) {
[372] Fix | Delete
if ( ! $provider->handles_type( $type ) ) {
[373] Fix | Delete
continue;
[374] Fix | Delete
}
[375] Fix | Delete
[376] Fix | Delete
try {
[377] Fix | Delete
$links = $provider->get_sitemap_links( $type, $entries_per_page, $this->current_page );
[378] Fix | Delete
} catch ( OutOfBoundsException $exception ) {
[379] Fix | Delete
$this->bad_sitemap = true;
[380] Fix | Delete
[381] Fix | Delete
return;
[382] Fix | Delete
}
[383] Fix | Delete
[384] Fix | Delete
$this->sitemap = $this->renderer->get_sitemap( $links, $type, $this->current_page );
[385] Fix | Delete
[386] Fix | Delete
return;
[387] Fix | Delete
}
[388] Fix | Delete
[389] Fix | Delete
if ( has_action( 'wpseo_do_sitemap_' . $type ) ) {
[390] Fix | Delete
/**
[391] Fix | Delete
* Fires custom handler, if hooked to generate sitemap for the type.
[392] Fix | Delete
*/
[393] Fix | Delete
do_action( 'wpseo_do_sitemap_' . $type );
[394] Fix | Delete
[395] Fix | Delete
return;
[396] Fix | Delete
}
[397] Fix | Delete
[398] Fix | Delete
$this->bad_sitemap = true;
[399] Fix | Delete
}
[400] Fix | Delete
[401] Fix | Delete
/**
[402] Fix | Delete
* Build the root sitemap (example.com/sitemap_index.xml) which lists sub-sitemaps for other content types.
[403] Fix | Delete
*
[404] Fix | Delete
* @return void
[405] Fix | Delete
*/
[406] Fix | Delete
public function build_root_map() {
[407] Fix | Delete
[408] Fix | Delete
$links = [];
[409] Fix | Delete
$entries_per_page = $this->get_entries_per_page();
[410] Fix | Delete
[411] Fix | Delete
foreach ( $this->providers as $provider ) {
[412] Fix | Delete
$links = array_merge( $links, $provider->get_index_links( $entries_per_page ) );
[413] Fix | Delete
}
[414] Fix | Delete
[415] Fix | Delete
/**
[416] Fix | Delete
* Filter the sitemap links array before the index sitemap is built.
[417] Fix | Delete
*
[418] Fix | Delete
* @param array $links Array of sitemap links
[419] Fix | Delete
*/
[420] Fix | Delete
$links = apply_filters( 'wpseo_sitemap_index_links', $links );
[421] Fix | Delete
[422] Fix | Delete
if ( empty( $links ) ) {
[423] Fix | Delete
$this->bad_sitemap = true;
[424] Fix | Delete
$this->sitemap = '';
[425] Fix | Delete
[426] Fix | Delete
return;
[427] Fix | Delete
}
[428] Fix | Delete
[429] Fix | Delete
$this->sitemap = $this->renderer->get_index( $links );
[430] Fix | Delete
}
[431] Fix | Delete
[432] Fix | Delete
/**
[433] Fix | Delete
* Spits out the XSL for the XML sitemap.
[434] Fix | Delete
*
[435] Fix | Delete
* @since 1.4.13
[436] Fix | Delete
*
[437] Fix | Delete
* @param string $type Type to output.
[438] Fix | Delete
*
[439] Fix | Delete
* @return void
[440] Fix | Delete
*/
[441] Fix | Delete
public function xsl_output( $type ) {
[442] Fix | Delete
[443] Fix | Delete
if ( $type !== 'main' ) {
[444] Fix | Delete
[445] Fix | Delete
/**
[446] Fix | Delete
* Fires for the output of XSL for XML sitemaps, other than type "main".
[447] Fix | Delete
*/
[448] Fix | Delete
do_action( 'wpseo_xsl_' . $type );
[449] Fix | Delete
[450] Fix | Delete
return;
[451] Fix | Delete
}
[452] Fix | Delete
[453] Fix | Delete
header( $this->http_protocol . ' 200 OK', true, 200 );
[454] Fix | Delete
// Prevent the search engines from indexing the XML Sitemap.
[455] Fix | Delete
header( 'X-Robots-Tag: noindex, follow', true );
[456] Fix | Delete
header( 'Content-Type: text/xml' );
[457] Fix | Delete
[458] Fix | Delete
// Make the browser cache this file properly.
[459] Fix | Delete
$expires = YEAR_IN_SECONDS;
[460] Fix | Delete
header( 'Pragma: public' );
[461] Fix | Delete
header( 'Cache-Control: max-age=' . $expires );
[462] Fix | Delete
header( 'Expires: ' . YoastSEO()->helpers->date->format_timestamp( ( time() + $expires ), 'D, d M Y H:i:s' ) . ' GMT' );
[463] Fix | Delete
[464] Fix | Delete
// Don't use WP_Filesystem() here because that's not initialized yet. See https://yoast.atlassian.net/browse/QAK-2043.
[465] Fix | Delete
readfile( WPSEO_PATH . 'css/main-sitemap.xsl' );
[466] Fix | Delete
}
[467] Fix | Delete
[468] Fix | Delete
/**
[469] Fix | Delete
* Spit out the generated sitemap.
[470] Fix | Delete
*
[471] Fix | Delete
* @return void
[472] Fix | Delete
*/
[473] Fix | Delete
public function output() {
[474] Fix | Delete
$this->send_headers();
[475] Fix | Delete
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaping sitemap as either xml or html results in empty document.
[476] Fix | Delete
echo $this->renderer->get_output( $this->sitemap );
[477] Fix | Delete
}
[478] Fix | Delete
[479] Fix | Delete
/**
[480] Fix | Delete
* Makes a request to the sitemap index to cache it before the arrival of the search engines.
[481] Fix | Delete
*
[482] Fix | Delete
* @return void
[483] Fix | Delete
*/
[484] Fix | Delete
public function hit_sitemap_index() {
[485] Fix | Delete
if ( ! $this->cache->is_enabled() ) {
[486] Fix | Delete
return;
[487] Fix | Delete
}
[488] Fix | Delete
[489] Fix | Delete
wp_remote_get( WPSEO_Sitemaps_Router::get_base_url( 'sitemap_index.xml' ) );
[490] Fix | Delete
}
[491] Fix | Delete
[492] Fix | Delete
/**
[493] Fix | Delete
* Get the GMT modification date for the last modified post in the post type.
[494] Fix | Delete
*
[495] Fix | Delete
* @since 3.2
[496] Fix | Delete
*
[497] Fix | Delete
* @param string|array $post_types Post type or array of types.
[498] Fix | Delete
* @param bool $return_all Flag to return array of values.
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function