( $link_type === SEO_Links::TYPE_EXTERNAL ) {
return false;
}
$modified = max( $post->post_modified_gmt, $post->post_date_gmt );
if ( $modified !== '0000-00-00 00:00:00' ) {
$url['mod'] = $modified;
}
$url['chf'] = 'daily'; // Deprecated, kept for backwards data compat. R.
$canonical = WPSEO_Meta::get_value( 'canonical', $post->ID );
if ( $canonical !== '' && $canonical !== $url['loc'] ) {
/*
* Let's assume that if a canonical is set for this page and it's different from
* the URL of this post, that page is either already in the XML sitemap OR is on
* an external site, either way, we shouldn't include it here.
*/
return false;
}
unset( $canonical );
$url['pri'] = 1; // Deprecated, kept for backwards data compat. R.
if ( $this->include_images ) {
$url['images'] = $this->get_image_parser()->get_images( $post );
}
return $url;
}
/**
* Get all dates for a post type by using the WITH clause for performance.
*
* @param string $post_type Post type to retrieve dates for.
* @param int $max_entries Maximum number of entries to retrieve.
*
* @return array Array of dates.
*/
private function get_all_dates_using_with_clause( $post_type, $max_entries ) {
global $wpdb;
$post_statuses = array_map( 'esc_sql', WPSEO_Sitemaps::get_post_statuses( $post_type ) );
$replacements = array_merge(
[
'ordering',
'post_modified_gmt',
$wpdb->posts,
'type_status_date',
'post_status',
],
$post_statuses,
[
'post_type',
$post_type,
'post_modified_gmt',
'post_modified_gmt',
'ordering',
$max_entries,
]
);
//phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- We need to use a direct query here.
//phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: No relevant caches.
return $wpdb->get_col(
//phpcs:disable WordPress.DB.PreparedSQLPlaceholders -- %i placeholder is still not recognized.
$wpdb->prepare(
'
WITH %i AS (SELECT ROW_NUMBER() OVER (ORDER BY %i) AS n, post_modified_gmt
FROM %i USE INDEX ( %i )
WHERE %i IN (' . implode( ', ', array_fill( 0, count( $post_statuses ), '%s' ) ) . ')
AND %i = %s
ORDER BY %i)
SELECT %i
FROM %i
WHERE MOD(n, %d) = 0;
',
$replacements
)
);
}
/**
* Get all dates for a post type.
*
* @param string $post_type Post type to retrieve dates for.
* @param int $max_entries Maximum number of entries to retrieve.
*
* @return array Array of dates.
*/
private function get_all_dates( $post_type, $max_entries ) {
global $wpdb;
$post_statuses = array_map( 'esc_sql', WPSEO_Sitemaps::get_post_statuses( $post_type ) );
$replacements = array_merge(
[
'post_modified_gmt',
$wpdb->posts,
'type_status_date',
'post_status',
],
$post_statuses,
[
'post_type',
$post_type,
$max_entries,
'post_modified_gmt',
]
);
return $wpdb->get_col(
//phpcs:disable WordPress.DB.PreparedSQLPlaceholders -- %i placeholder is still not recognized.
$wpdb->prepare(
'
SELECT %i
FROM ( SELECT @rownum:=0 ) init
JOIN %i USE INDEX( %i )
WHERE %i IN (' . implode( ', ', array_fill( 0, count( $post_statuses ), '%s' ) ) . ')
AND %i = %s
AND ( @rownum:=@rownum+1 ) %% %d = 0
ORDER BY %i ASC
',
$replacements
)
);
}
}
Fatal error: Uncaught Error: Class 'WPSEO_Post_Type_Sitemap_Provider' not found in /var/www/html/netlogic.com.br/web/wp-content/plugins/wordpress-seo/inc/sitemaps/class-sitemaps.php:124
Stack trace:
#0 /var/www/html/netlogic.com.br/web/wp-includes/class-wp-hook.php(324): WPSEO_Sitemaps->init_sitemaps_providers('')
#1 /var/www/html/netlogic.com.br/web/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#2 /var/www/html/netlogic.com.br/web/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /var/www/html/netlogic.com.br/web/wp-settings.php(678): do_action('after_setup_the...')
#4 /var/www/html/netlogic.com.br/web/wp-config.php(101): require_once('/var/www/html/n...')
#5 /var/www/html/netlogic.com.br/web/wp-load.php(50): require_once('/var/www/html/n...')
#6 /var/www/html/netlogic.com.br/web/wp-blog-header.php(13): require_once('/var/www/html/n...')
#7 /var/www/html/netlogic.com.br/web/index.php(17): require('/var/www/html/n...')
#8 {main}
thrown in /var/www/html/netlogic.com.br/web/wp-content/plugins/wordpress-seo/inc/sitemaps/class-sitemaps.php on line 124