und in the post content. * * @since 4.0.0 * * @return string The image URL. */ private function getFirstImageInContent() { $cachedImage = $this->getCachedImage(); if ( $cachedImage ) { return $cachedImage; } $postContent = aioseo()->helpers->getPostContent( $this->post ); preg_match_all( '||i', $postContent, $matches ); // Ignore cover block background image - WP >= 5.7. if ( ! empty( $matches[0] ) && apply_filters( 'aioseo_social_image_ignore_cover_block', true, $this->post, $matches ) ) { foreach ( $matches[0] as $key => $match ) { if ( false !== stripos( $match, 'wp-block-cover__image-background' ) ) { unset( $matches[1][ $key ] ); } } } return ! empty( $matches[1] ) ? current( $matches[1] ) : ''; } /** * Returns the author avatar. * * @since 4.0.0 * * @return string The image URL. */ private function getAuthorAvatar() { $avatar = get_avatar( $this->post->post_author, 300 ); preg_match( "/src='(.*?)'/i", $avatar, $matches ); return ! empty( $matches[1] ) ? $matches[1] : ''; } /** * Returns the first available image. * * @since 4.0.0 * * @return string The image URL. */ private function getFirstAvailableImage() { // Disable the cache. $this->useCache = false; $image = $this->getCustomFieldImage(); if ( ! $image ) { $image = $this->getFeaturedImage(); } if ( ! $image ) { $image = $this->getFirstAttachedImage(); } if ( ! $image ) { $image = $this->getFirstImageInContent(); } if ( ! $image && 'twitter' === strtolower( $this->type ) ) { $image = aioseo()->options->social->twitter->homePage->image; } // Enable the cache. $this->useCache = true; return $image ? $image : aioseo()->options->social->facebook->homePage->image; } /** * Returns the image from a custom field. * * @since 4.0.0 * * @return string The image URL. */ private function getCustomFieldImage() { $cachedImage = $this->getCachedImage(); if ( $cachedImage ) { return $cachedImage; } $prefix = 'facebook' === strtolower( $this->type ) ? 'og_' : 'twitter_'; $aioseoPost = Models\Post::getPost( $this->post->ID ); $customFields = ! empty( $aioseoPost->{ $prefix . 'image_custom_fields' } ) ? $aioseoPost->{ $prefix . 'image_custom_fields' } : aioseo()->options->social->{$this->type}->general->customFieldImagePosts; if ( ! $customFields ) { return ''; } $customFields = explode( ',', $customFields ); foreach ( $customFields as $customField ) { $image = get_post_meta( $this->post->ID, $customField, true ); if ( ! empty( $image ) ) { return is_numeric( $image ) ? wp_get_attachment_image_src( $image, $this->thumbnailSize ) : $image; } } return ''; } /** * Returns the cached image if there is one. * * @since 4.1.6.2 * * @param WP_term The object for which we need to get the cached image. * @return string|array The image URL or data. */ protected function getCachedImage( $object = null ) { if ( null === $object ) { // This isn't null if we call it from the Pro class. $object = $this->post; } $metaData = aioseo()->meta->metaData->getMetaData( $object ); switch ( $this->type ) { case 'facebook': if ( ! empty( $metaData->og_image_url ) && $this->useCache ) { return aioseo()->meta->metaData->getCachedOgImage( $metaData ); } break; case 'twitter': if ( ! empty( $metaData->twitter_image_url ) && $this->useCache ) { return $metaData->twitter_image_url; } break; default: break; } return ''; } }
Fatal error: Uncaught Error: Class 'AIOSEO\Plugin\Common\Social\Image' not found in /home/ozzazope/public_html/riverside/wp-content/plugins/all-in-one-seo-pack/app/Common/Social/Social.php:32 Stack trace: #0 /home/ozzazope/public_html/riverside/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(398): AIOSEO\Plugin\Common\Social\Social->__construct() #1 /home/ozzazope/public_html/riverside/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(184): AIOSEO\Plugin\AIOSEO->load() #2 /home/ozzazope/public_html/riverside/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(164): AIOSEO\Plugin\AIOSEO->init() #3 /home/ozzazope/public_html/riverside/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(488): AIOSEO\Plugin\AIOSEO::instance() #4 /home/ozzazope/public_html/riverside/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php(94): aioseo() #5 /home/ozzazope/public_html/riverside/wp-settings.php(433): include_once('/home/ozzazope/...') #6 /home/ozzazope/public_html/riverside/wp-config.php(95): require_once('/hom in /home/ozzazope/public_html/riverside/wp-content/plugins/all-in-one-seo-pack/app/Common/Social/Social.php on line 32