ption = '';
$metaData = aioseo()->meta->metaData->getMetaData( $post );
if ( ! empty( $metaData->description ) && ! $default ) {
$description = $this->helpers->prepare( $metaData->description, $post->ID, false );
}
if (
$description ||
(
in_array( 'autogenerateDescriptions', aioseo()->internalOptions->deprecatedOptions, true ) &&
! aioseo()->options->deprecated->searchAppearance->advanced->autogenerateDescriptions
)
) {
$posts[ $post->ID ] = $description;
return $description;
}
$description = $this->helpers->sanitize( $this->getPostTypeDescription( $post->post_type ), $post->ID, $default );
$generateDescriptions = apply_filters( 'aioseo_generate_descriptions_from_content', true, [ $post ] );
if ( ! $description && ! post_password_required( $post ) ) {
$description = $post->post_excerpt;
if (
$generateDescriptions &&
in_array( 'useContentForAutogeneratedDescriptions', aioseo()->internalOptions->deprecatedOptions, true ) &&
aioseo()->options->deprecated->searchAppearance->advanced->useContentForAutogeneratedDescriptions
) {
$description = aioseo()->helpers->getDescriptionFromContent( $post );
}
$description = $this->helpers->sanitize( $description, $post->ID, $default );
if ( ! $description && $generateDescriptions && $post->post_content ) {
$description = $this->helpers->sanitize( aioseo()->helpers->getDescriptionFromContent( $post ), $post->ID, $default );
}
}
if ( ! is_paged() ) {
if ( in_array( 'descriptionFormat', aioseo()->internalOptions->deprecatedOptions, true ) ) {
$descriptionFormat = aioseo()->options->deprecated->searchAppearance->global->descriptionFormat;
if ( $descriptionFormat ) {
$description = preg_replace( '/#description/', $description, $descriptionFormat );
}
}
}
$posts[ $post->ID ] = $description ? $this->helpers->prepare( $description, $post->ID, $default ) : $this->helpers->prepare( term_description( '' ), $post->ID, $default );
return $posts[ $post->ID ];
}
/**
* Retrieve the default description for the post type.
*
* @since 4.0.6
*
* @param string $postType The post type.
* @return string The description.
*/
public function getPostTypeDescription( $postType ) {
static $postTypeDescription = [];
if ( isset( $postTypeDescription[ $postType ] ) ) {
return $postTypeDescription[ $postType ];
}
if ( aioseo()->dynamicOptions->searchAppearance->postTypes->has( $postType ) ) {
$description = aioseo()->dynamicOptions->searchAppearance->postTypes->{$postType}->metaDescription;
}
$postTypeDescription[ $postType ] = empty( $description ) ? '' : $description;
return $postTypeDescription[ $postType ];
}
/**
* Returns the term description.
*
* @since 4.0.6
*
* @param \WP_Term $term The term object.
* @param boolean $default Whether we want the default value, not the post one.
* @return string The term description.
*/
public function getTermDescription( $term, $default = false ) {
if ( ! is_a( $term, 'WP_Term' ) ) {
return '';
}
static $terms = [];
if ( isset( $terms[ $term->term_id ] ) ) {
return $terms[ $term->term_id ];
}
$description = '';
if (
in_array( 'autogenerateDescriptions', aioseo()->internalOptions->deprecatedOptions, true ) &&
! aioseo()->options->deprecated->searchAppearance->advanced->autogenerateDescriptions
) {
$terms[ $term->term_id ] = $description;
return $description;
}
$dynamicOptions = aioseo()->dynamicOptions->noConflict();
if ( ! $description && $dynamicOptions->searchAppearance->taxonomies->has( $term->taxonomy ) ) {
$description = $this->helpers->prepare( aioseo()->dynamicOptions->searchAppearance->taxonomies->{$term->taxonomy}->metaDescription, false, $default );
}
$terms[ $term->term_id ] = $description ? $description : $this->helpers->prepare( term_description( $term->term_id ), false, $default );
return $terms[ $term->term_id ];
}
}
Fatal error: Uncaught Error: Class "AIOSEO\Plugin\Common\Meta\Description" not found in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/Pro/Meta/Description.php:16
Stack trace:
#0 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/vendor/composer/ClassLoader.php(576): include()
#1 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('/home/valigeria...')
#2 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/Pro/Meta/Meta.php(71): Composer\Autoload\ClassLoader->loadClass('AIOSEO\\Plugin\\P...')
#3 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(298): AIOSEO\Plugin\Pro\Meta\Meta->__construct()
#4 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(97): AIOSEO\Plugin\AIOSEO->load()
#5 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(76): AIOSEO\Plugin\AIOSEO->init()
#6 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(414): AIOSEO\Plugin\AIOSEO::instance()
#7 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/all_in_one_seo_pack.php(96): aioseo()
#8 /home/valigeria/public_html/wp-settings.php(517): include_once('/home/valigeria...')
#9 /home/valigeria/public_html/wp-config.php(111): require_once('/home/valigeria...')
#10 /home/valigeria/public_html/wp-load.php(50): require_once('/home/valigeria...')
#11 /home/valigeria/public_html/wp-blog-header.php(13): require_once('/home/valigeria...')
#12 /home/valigeria/public_html/index.php(17): require('/home/valigeria...')
#13 {main}
thrown in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/Pro/Meta/Description.php on line 16