SC',
'meta_query' => [
'relation' => 'AND',
[
'relation' => 'OR',
[
'key' => 'last_update',
],
[
'key' => 'last_update',
'compare' => 'NOT EXISTS',
],
],
[
'relation' => 'OR',
[
'key' => 'rank_math_robots',
'value' => 'noindex',
'compare' => 'NOT LIKE',
],
[
'key' => 'rank_math_robots',
'compare' => 'NOT EXISTS',
],
],
],
];
$args = $this->do_filter( 'sitemap/author/query', wp_parse_args( $args, $defaults ) );
return get_users( $args );
}
/**
* Exclude users.
*
* @param array $args Array of user query arguments.
*
* @return array
*/
public function exclude_users( $args ) {
$exclude = Helper::get_settings( 'sitemap.exclude_users' );
if ( ! empty( $exclude ) ) {
$args['exclude'] = wp_parse_id_list( $exclude );
}
return $args;
}
/**
* Exclude roles.
*
* @param array $args Array of user query arguments.
*
* @return array
*/
public function exclude_roles( $args ) {
$exclude_roles = Helper::get_settings( 'sitemap.exclude_roles' );
if ( ! empty( $exclude_roles ) ) {
$args['role__not_in'] = $exclude_roles;
}
return $args;
}
/**
* Exclude post types.
*
* @param array $args Array of user query arguments.
*
* @return array
*/
public function exclude_post_types( $args ) {
// Exclude post types.
$public_post_types = get_post_types( [ 'public' => true ] );
// We're not supporting sitemaps for author pages for attachments.
unset( $public_post_types['attachment'] );
$args['has_published_posts'] = array_keys( $public_post_types );
return $args;
}
/**
* Get all users according to author sitemap settings.
*
* @return array
*/
private function get_index_users() {
global $wpdb;
$exclude_users = Helper::get_settings( 'sitemap.exclude_users' );
$exclude_roles = Helper::get_settings( 'sitemap.exclude_roles' );
$exclude_users_query = ! $exclude_users ? '' : 'AND post_author NOT IN ( ' . esc_sql( $exclude_users ) . ' )';
$exclude_roles_query = '';
$meta_query = "(
( um.meta_key = 'rank_math_robots' AND um.meta_value NOT LIKE '%noindex%' )
OR um.user_id IS NULL
)
AND ( umt1.meta_key = 'last_update' OR umt1.user_id IS NULL )
";
if ( $exclude_roles ) {
$exclude_roles_query = "AND ( umt.meta_key ='wp_capabilities' AND ( ";
foreach ( $exclude_roles as $key => $role ) {
$exclude_roles_query .= 0 === $key ? " umt.meta_value NOT LIKE '%" . esc_sql( $role ) . "%'" : " AND umt.meta_value NOT LIKE '%" . esc_sql( $role ) . "%'";
}
$exclude_roles_query .= ' ) )';
}
$meta_query .= $exclude_roles_query;
$sql = "
SELECT u.ID, umt1.meta_value as last_update
FROM {$wpdb->users} as u
LEFT JOIN {$wpdb->usermeta} AS um ON ( u.ID = um.user_id AND um.meta_key = 'rank_math_robots' )
LEFT JOIN {$wpdb->usermeta} AS umt ON ( u.ID = umt.user_id AND umt.meta_key = 'wp_capabilities' )
LEFT JOIN {$wpdb->usermeta} AS umt1 ON ( u.ID = umt1.user_id AND umt1.meta_key = 'last_update' )
WHERE ( {$meta_query} )
AND u.ID IN (
SELECT post_author
FROM {$wpdb->posts} as p
WHERE p.post_status = 'publish' AND p.post_password = ''
{$exclude_users_query}
)
ORDER BY umt1.meta_value DESC
";
return $wpdb->get_results( $sql ); // phpcs:ignore
}
}
Fatal error: Uncaught Error: Class 'RankMath\Sitemap\Providers\Author' not found in /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/html-sitemap/class-authors.php:23
Stack trace:
#0 /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math-pro/vendor/composer/ClassLoader.php(571): include()
#1 /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math-pro/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/home/candoodes...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('RankMath\\Sitema...')
#3 /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/html-sitemap/class-sitemap.php(53): spl_autoload_call('RankMath\\Sitema...')
#4 /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-sitemap.php(54): RankMath\Sitemap\Html\Sitemap->__construct()
#5 /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math/includes/module/c in /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/html-sitemap/class-authors.php on line 23