ded. * * @since 4.2.4 * * @param int $postId The post ID. * @return bool Whether the post should be excluded. */ private function isExcludedPost( $postId ) { static $excludedPostIds = null; if ( null === $excludedPostIds ) { $excludedPostIds = explode( ', ', aioseo()->sitemap->helpers->excludedPosts() ); $excludedPostIds = array_map( function ( $postId ) { return (int) $postId; }, $excludedPostIds ); } if ( in_array( $postId, $excludedPostIds, true ) ) { return true; } // Let's also check if the post is published and not password-protected. $post = get_post( $postId ); if ( ! is_a( $post, 'WP_Post' ) ) { return true; } if ( ! empty( $post->post_password ) || 'publish' !== $post->post_status ) { return true; } // Now, we must also check for noindex. $metaData = aioseo()->meta->metaData->getMetaData( $post ); if ( ! empty( $metaData->robots_noindex ) ) { return true; } return false; } /** * Checks whether the given term should be excluded. * * @since 4.2.4 * * @param int $termId The term ID. * @return bool Whether the term should be excluded. */ private function isExcludedTerm( $termId ) { static $excludedTermIds = null; if ( null === $excludedTermIds ) { $excludedTermIds = explode( ', ', aioseo()->sitemap->helpers->excludedTerms() ); $excludedTermIds = array_map( function ( $termId ) { return (int) $termId; }, $excludedTermIds ); } if ( in_array( $termId, $excludedTermIds, true ) ) { return true; } // At least one post must be assigned to the term. $posts = aioseo()->core->db->start( 'term_relationships' ) ->select( 'object_id' ) ->where( 'term_taxonomy_id =', $termId ) ->limit( 1 ) ->run() ->result(); if ( empty( $posts ) ) { return true; } // Now, we must also check for noindex. $term = get_term( $termId ); if ( ! is_a( $term, 'WP_Term' ) ) { return true; } $metaData = aioseo()->meta->metaData->getMetaData( $term ); if ( ! empty( $metaData->robots_noindex ) ) { return true; } return false; } }
Fatal error: Uncaught Error: Class "AIOSEO\Plugin\Common\Sitemap\Localization" not found in /htdocs/wp-content/plugins/all-in-one-seo-pack/app/Common/Sitemap/Sitemap.php:98 Stack trace: #0 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(311): AIOSEO\Plugin\Common\Sitemap\Sitemap->__construct() #1 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(97): AIOSEO\Plugin\AIOSEO->load() #2 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(76): AIOSEO\Plugin\AIOSEO->init() #3 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(413): AIOSEO\Plugin\AIOSEO::instance() #4 /htdocs/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php(96): aioseo() #5 /htdocs/wp-settings.php(462): include_once('/htdocs/wp-cont...') #6 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #7 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #8 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #9 /htdocs/index.php(17): require('/htdocs/wp-blog...') #10 {main} thrown in /htdocs/wp-content/plugins/all-in-one-seo-pack/app/Common/Sitemap/Sitemap.php on line 98