s(); } /** * Adds the dynamic defaults for the public post types. * * @since 4.1.4 * * @return void */ protected function addDynamicPostTypeDefaults() { $postTypes = aioseo()->helpers->getPublicPostTypes(); foreach ( $postTypes as $postType ) { if ( 'type' === $postType['name'] ) { $postType['name'] = '_aioseo_type'; } $defaultTitle = '#post_title #separator_sa #site_title'; $defaultDescription = $postType['hasExcerpt'] ? '#post_excerpt' : '#post_content'; $defaultSchemaType = 'WebPage'; $defaultWebPageType = 'WebPage'; $defaultArticleType = 'BlogPosting'; switch ( $postType['name'] ) { case 'post': $defaultSchemaType = 'Article'; break; case 'attachment': $defaultDescription = '#attachment_caption'; $defaultSchemaType = 'ItemPage'; $defaultWebPageType = 'ItemPage'; break; case 'product': $defaultSchemaType = 'WebPage'; $defaultWebPageType = 'ItemPage'; break; case 'news': $defaultArticleType = 'NewsArticle'; break; default: break; } $defaultOptions = array_replace_recursive( $this->getDefaultSearchAppearanceOptions(), [ 'title' => [ 'type' => 'string', 'localized' => true, 'default' => $defaultTitle ], 'metaDescription' => [ 'type' => 'string', 'localized' => true, 'default' => $defaultDescription ], 'schemaType' => [ 'type' => 'string', 'default' => $defaultSchemaType ], 'webPageType' => [ 'type' => 'string', 'default' => $defaultWebPageType ], 'articleType' => [ 'type' => 'string', 'default' => $defaultArticleType ], 'customFields' => [ 'type' => 'html' ], 'advanced' => [ 'bulkEditing' => [ 'type' => 'string', 'default' => 'enabled' ] ] ] ); if ( 'attachment' === $postType['name'] ) { $defaultOptions['redirectAttachmentUrls'] = [ 'type' => 'string', 'default' => 'attachment' ]; } $this->defaults['searchAppearance']['postTypes'][ $postType['name'] ] = $defaultOptions; $this->setDynamicSocialOptions( 'postTypes', $postType['name'] ); $this->setDynamicSitemapOptions( 'postTypes', $postType['name'] ); } } /** * Adds the dynamic defaults for the public taxonomies. * * @since 4.1.4 * * @return void */ protected function addDynamicTaxonomyDefaults() { $taxonomies = aioseo()->helpers->getPublicTaxonomies(); foreach ( $taxonomies as $taxonomy ) { if ( 'type' === $taxonomy['name'] ) { $taxonomy['name'] = '_aioseo_type'; } $defaultOptions = array_replace_recursive( $this->getDefaultSearchAppearanceOptions(), [ 'title' => [ 'type' => 'string', 'localized' => true, 'default' => '#taxonomy_title #separator_sa #site_title' ], 'metaDescription' => [ 'type' => 'string', 'localized' => true, 'default' => '#taxonomy_description' ], ] ); $this->setDynamicSitemapOptions( 'taxonomies', $taxonomy['name'] ); $this->defaults['searchAppearance']['taxonomies'][ $taxonomy['name'] ] = $defaultOptions; } } /** * Adds the dynamic defaults for the archive pages. * * @since 4.1.4 * * @return void */ protected function addDynamicArchiveDefaults() { $postTypes = aioseo()->helpers->getPublicPostTypes( false, true ); foreach ( $postTypes as $postType ) { if ( 'type' === $postType['name'] ) { $postType['name'] = '_aioseo_type'; } $defaultOptions = array_replace_recursive( $this->getDefaultSearchAppearanceOptions(), [ 'title' => [ 'type' => 'string', 'localized' => true, 'default' => '#archive_title #separator_sa #site_title' ], 'metaDescription' => [ 'type' => 'string', 'localized' => true, 'default' => '' ], 'customFields' => [ 'type' => 'html' ], 'advanced' => [ 'keywords' => [ 'type' => 'string', 'localized' => true ] ] ] ); $this->defaults['searchAppearance']['archives'][ $postType['name'] ] = $defaultOptions; } } /** * Returns the search appearance options for dynamic objects. * * @since 4.1.4 * * @return array The default options. */ protected function getDefaultSearchAppearanceOptions() { return [ // phpcs:disable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound 'show' => [ 'type' => 'boolean', 'default' => true ], 'advanced' => [ 'robotsMeta' => [ 'default' => [ 'type' => 'boolean', 'default' => true ], 'noindex' => [ 'type' => 'boolean', 'default' => false ], 'nofollow' => [ 'type' => 'boolean', 'default' => false ], 'noarchive' => [ 'type' => 'boolean', 'default' => false ], 'noimageindex' => [ 'type' => 'boolean', 'default' => false ], 'notranslate' => [ 'type' => 'boolean', 'default' => false ], 'nosnippet' => [ 'type' => 'boolean', 'default' => false ], 'noodp' => [ 'type' => 'boolean', 'default' => false ], 'maxSnippet' => [ 'type' => 'number', 'default' => -1 ], 'maxVideoPreview' => [ 'type' => 'number', 'default' => -1 ], 'maxImagePreview' => [ 'type' => 'string', 'default' => 'large' ] ], 'showDateInGooglePreview' => [ 'type' => 'boolean', 'default' => true ], 'showPostThumbnailInSearch' => [ 'type' => 'boolean', 'default' => true ], 'showMetaBox' => [ 'type' => 'boolean', 'default' => true ] ] ]; // phpcs:enable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound } /** * Sets the dynamic social settings for a given post type or taxonomy. * * @since 4.1.4 * * @param string $objectType Whether the object belongs to the dynamic "postTypes" or "taxonomies". * @param string $objectName The object name. * @return void */ protected function setDynamicSocialOptions( $objectType, $objectName ) { $defaultOptions = [ 'objectType' => [ 'type' => 'string', 'default' => 'article' ] ]; $this->defaults['social']['facebook']['general'][ $objectType ][ $objectName ] = $defaultOptions; } /** * Sets the dynamic sitemap settings for a given post type or taxonomy. * * @since 4.1.4 * * @param string $objectType Whether the object belongs to the dynamic "postTypes" or "taxonomies". * @param string $objectName The object name. * @return void */ protected function setDynamicSitemapOptions( $objectType, $objectName ) { $this->defaults['sitemap']['priority'][ $objectType ][ $objectName ] = [ 'priority' => [ 'type' => 'string', 'default' => '{"label":"default","value":"default"}' ], 'frequency' => [ 'type' => 'string', 'default' => '{"label":"default","value":"default"}' ] ]; } }
Fatal error: Uncaught Error: Class "AIOSEO\Plugin\Common\Options\DynamicOptions" not found in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/Pro/Options/DynamicOptions.php:18 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/AIOSEO.php(289): Composer\Autoload\ClassLoader->loadClass('AIOSEO\\Plugin\\P...') #3 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(97): AIOSEO\Plugin\AIOSEO->load() #4 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(76): AIOSEO\Plugin\AIOSEO->init() #5 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(414): AIOSEO\Plugin\AIOSEO::instance() #6 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/all_in_one_seo_pack.php(96): aioseo() #7 /home/valigeria/public_html/wp-settings.php(517): include_once('/home/valigeria...') #8 /home/valigeria/public_html/wp-config.php(111): require_once('/home/valigeria...') #9 /home/valigeria/public_html/wp-load.php(50): require_once('/home/valigeria...') #10 /home/valigeria/public_html/wp-blog-header.php(13): require_once('/home/valigeria...') #11 /home/valigeria/public_html/index.php(17): require('/home/valigeria...') #12 {main} thrown in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/Pro/Options/DynamicOptions.php on line 18