__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
* The functions in this class provide an API for handling
* sitemap related URIs.
*
* @package automattic/jetpack
* @since 4.8.0
* @author Automattic
*/
/**
* The Jetpack_Sitemap_Finder object deals with constructing
* sitemap URIs.
*
* @since 4.8.0
*/
class Jetpack_Sitemap_Finder {
/**
* Construct the complete URL of a sitemap file. Depends on
* permalink settings.
*
* @access public
* @since 4.8.0
* @since 4.8.1 Call jetpack_sitemap_uri()
*
* @param string $filename The filename of the sitemap.
*
* @return string Complete URI of the given sitemap file.
*/
public function construct_sitemap_url( $filename ) {
$url = jetpack_sitemap_uri( $filename );
if ( pathinfo( $filename, PATHINFO_EXTENSION ) === 'xsl' ) {
// Strip scheme for sites where sitemap could be access via http or https.
$url = preg_replace( '/^https?:/', '', $url );
}
return $url;
}
/**
* Path and query prefix of sitemap files. Depends on permalink
* settings.
*
* @access public
* @since 4.8.0
*
* @return string The path+query prefix.
*/
public function the_jetpack_sitemap_path_and_query_prefix() {
global $wp_rewrite;
// Get path fragment from home_url().
$home = wp_parse_url( home_url() );
if ( isset( $home['path'] ) ) {
$home_path = $home['path'];
} else {
$home_path = '';
}
// Get additional path fragment from filter.
$location = Jetpack_Options::get_option_and_ensure_autoload(
'jetpack_sitemap_location',
''
);
if ( $wp_rewrite->using_index_permalinks() ) {
return $home_path . '/index.php' . $location . '/';
} elseif ( $wp_rewrite->using_permalinks() ) {
return $home_path . $location . '/';
} else {
return $home_path . $location . '/?jetpack-sitemap=';
}
}
/**
* Examine a path+query URI fragment looking for a sitemap request.
*
* @access public
* @since 4.8.0
*
* @param string $raw_uri A URI (path+query only) to test for sitemap-ness.
*
* @return array @args {
* @type string $sitemap_name The recognized sitemap name (or null).
* }
*/
public function recognize_sitemap_uri( $raw_uri ) {
// The path+query where sitemaps are served.
$sitemap_path = $this->the_jetpack_sitemap_path_and_query_prefix();
// A regex which detects $sitemap_path at the beginning of a string.
$path_regex = '/^' . preg_quote( $sitemap_path, '/' ) . '/';
// Check that the request URI begins with the sitemap path.
if ( preg_match( $path_regex, $raw_uri ) ) {
// Strip off the $sitemap_path and any trailing slash.
$stripped_uri = preg_replace( $path_regex, '', rtrim( $raw_uri, '/' ) );
} else {
$stripped_uri = '';
}
// Check that the stripped uri begins with one of the sitemap prefixes.
if ( preg_match( '/^sitemap|^image-s|^news-s|^video-s/', $stripped_uri ) ) {
$filename = $stripped_uri;
} else {
$filename = null;
}
return array(
'sitemap_name' => $filename,
);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| sitemap-buffer-fallback.php | File | 4.04 KB | 0644 |
|
| sitemap-buffer-image-fallback.php | File | 1.95 KB | 0644 |
|
| sitemap-buffer-image.php | File | 2.57 KB | 0644 |
|
| sitemap-buffer-master-fallback.php | File | 1.32 KB | 0644 |
|
| sitemap-buffer-master.php | File | 1.9 KB | 0644 |
|
| sitemap-buffer-news-fallback.php | File | 1.97 KB | 0644 |
|
| sitemap-buffer-news.php | File | 2.58 KB | 0644 |
|
| sitemap-buffer-page-fallback.php | File | 1.88 KB | 0644 |
|
| sitemap-buffer-page.php | File | 2.5 KB | 0644 |
|
| sitemap-buffer-video-fallback.php | File | 1.96 KB | 0644 |
|
| sitemap-buffer-video.php | File | 2.57 KB | 0644 |
|
| sitemap-buffer.php | File | 8.01 KB | 0644 |
|
| sitemap-builder.php | File | 39.82 KB | 0644 |
|
| sitemap-constants.php | File | 5.66 KB | 0644 |
|
| sitemap-finder.php | File | 2.95 KB | 0644 |
|
| sitemap-librarian.php | File | 11.59 KB | 0644 |
|
| sitemap-logger.php | File | 2.34 KB | 0644 |
|
| sitemap-state.php | File | 4.23 KB | 0644 |
|
| sitemap-stylist.php | File | 20.49 KB | 0644 |
|
| sitemaps.php | File | 17.92 KB | 0644 |
|