If the article has meta description set in the source, use that

@return string
333312
private function getMetaDescription(): string {
        $desc = $this->getMetaContent($this->article()->getDoc(), 'name', 'description');

        if (empty($desc)) {
            $desc = $this->getMetaContent($this->article()->getDoc(), 'property', 'og:description');
        }

        if (empty($desc)) {
            $desc = $this->getMetaContent($this->article()->getDoc(), 'name', 'twitter:description');
        }

        return trim($desc);
    }
977901
public function metaData()
    {
        Meta::setTitle($this->title)
            ->set("description", $this->about)
            ->set("og:type", "website", "property")
            ->set("og:title", $this->title, "property")
            ->set("og:description", $this->description, "property")
            ->set("og:url", $this->href, "property")
            ->setImageOG(($this->hasFeaturedImage() ? $this->featuredImage : null))
            ->setCanonical($this->href)
            ->setWildcards(
                [
                '{{title}}' => $this->title,
                '{{sitename}}' => settings('siteTitle')
                ]
            );
    }
362663
protected function validateMetaTitle()
    {
        $field = 'meta_title';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return true;
        }

        if (mb_strlen($value) > 60) {
            $this->setErrorLengthRange($field, $this->translation->text('Meta title'), 0, 60);
            return false;
        }

        return true;
    }
122037
public function GenerateExtraMeta()
    {
        if ($this->owner->ExtraMeta) {
            return $this->owner->ExtraMeta . PHP_EOL;
        } else {
            return $this->owner->MarkupComment('none');
        }
    }
1013791
public function detectUrlDetails()
    {
        $escapedPathPrefix = Text::escapeForRegex($this->config->getPathPrefix());
        $languages = implode('|', $this->translate->getLanguages());

        $fullUrl = preg_replace('#' . $escapedPathPrefix . '\/(' . $languages . ')$#i', '', $this->getUrl());
        $fullUrl = preg_replace('#' . $escapedPathPrefix . '\/(' . $languages . ')\/#i', '/', $fullUrl);

        $parsed = parse_url($fullUrl);

        $this->host = $parsed['scheme'] . '://' . $parsed['host'] . (isset($parsed['port']) ? ':'.$parsed['port'] : '');
        $this->path = isset($parsed['path']) ? $parsed['path'] : '/';
        $this->query = isset($parsed['query']) ? $parsed['query'] : null;

        if (preg_match('#^' .$this->config->getPathPrefix(). '#i', $this->path)) {
            $this->path = preg_replace('#^' .$this->config->getPathPrefix(). '#i', '', $this->path);
        }

        if ($this->path === "") {
            $this->path = '/';
        }

        $url = $this->getHost() . $this->getPathPrefix() . $this->getPath();
        if (!is_null($this->getQuery())) {
            $url .= '?'. $this->getQuery();
        }
        return $url;
    }
821833
public function getMetaTitle()
    {
        $title = $this->data()->getTitle();
        $filter = $this->FilterDescription();
        if ($filter) {
            $title = "{$title} - {$filter}";
        }

        $this->extend('updateMetaTitle', $title);
        return $title;
    }
292681
private function __metaToData()
    {
        $strReturn = "";

        if (isset($this->__meta["data"]) && is_array($this->__meta["data"])) {
            foreach ($this->__meta["data"] as $strKey => $strValue) {
                $strReturn .= "data-" . strtolower($strKey) . "=\"" . $strValue . "\" ";
            }
        }

        return $strReturn;
    }
666109
public function getMetaContent()
    {
        if ($this->owner->hasField('Content') && $this->owner->Content) {
            return $this->owner->dbObject('Content');
        }
    }
276318
public function getMetaMarkup()
    {
        $html = "";

        foreach ($this->getMeta() as $name => $content)
        {
            if(is_array($content)) {
                foreach($content as $cont)
                    $html .= "<meta name=\"{$name}\" content=\"{$cont}\">\n";
            } else {
                $html .= "<meta name=\"{$name}\" content=\"{$content}\">\n";
            }
        }

        return $html;
    }
91174
public function description($default = null)
  {
    if (!$k = $this->getDescription()) {
      $d = $default ?: $this->getDefaultDescription();
      $k = is_null($d) ? $this->getTitle() : $d;
    }

    return new Tag('meta', null, array('name' => 'description', 'content' => $k), true);
  }
556821
public function getOGDescription()
    {
        // Use MetaDescription if set
        if ($this->owner->MetaDescription) {
            $description = trim($this->owner->MetaDescription);
            if (!empty($description)) {
                return $description;
            }
        }

        return $this->owner->getDefaultOGDescription();
    }
687940
protected function __getMetaString()
    {
        $strOutput = "";

        foreach ($this->__meta as $key => $value) {
            if (! in_array($key, array_merge($this->__reservedmeta, $this->__fieldmeta))) {
                $strOutput .= " {$key}=\"{$value}\"";
            }
        }

        return $strOutput;
    }
1231786
protected function get_plugin_meta() {
		// Ensure get_plugins() function is available.
		include_once ABSPATH . '/wp-admin/includes/plugin.php';

		$plugins     = get_plugins();
		$git_plugins = [];

		/**
		 * Filter to add plugins not containing appropriate header line.
		 *
		 * @since   5.4.0
		 * @access  public
		 *
		 * @param array $additions Listing of plugins to add.
		 *                         Default null.
		 * @param array $plugins   Listing of all plugins.
		 * @param         string        'plugin'    Type being passed.
		 */
		$additions = apply_filters( 'github_updater_additions', null, $plugins, 'plugin' );
		$plugins   = array_merge( $plugins, (array) $additions );

		foreach ( (array) $plugins as $plugin => $headers ) {
			$git_plugin = [];

			foreach ( (array) static::$extra_headers as $value ) {
				$header = null;

				if ( empty( $headers[ $value ] ) || false === stripos( $value, 'Plugin' ) ) {
					continue;
				}

				$header_parts = explode( ' ', $value );
				$repo_parts   = $this->get_repo_parts( $header_parts[0], 'plugin' );

				if ( $repo_parts['bool'] ) {
					$header = $this->parse_header_uri( $headers[ $value ] );
					if ( empty( $header ) ) {
						continue;
					}
				}

				$header         = $this->parse_extra_headers( $header, $headers, $header_parts, $repo_parts );
				$current_branch = "current_branch_{$header['repo']}";
				$branch         = isset( static::$options[ $current_branch ] )
					? static::$options[ $current_branch ]
					: false;

				$git_plugin['type']           = 'plugin';
				$git_plugin['git']            = $repo_parts['git_server'];
				$git_plugin['uri']            = "{$header['base_uri']}/{$header['owner_repo']}";
				$git_plugin['enterprise']     = $header['enterprise_uri'];
				$git_plugin['enterprise_api'] = $header['enterprise_api'];
				$git_plugin['owner']          = $header['owner'];
				$git_plugin['slug']           = $header['repo'];
				$git_plugin['branch']         = $branch ?: 'master';
				$git_plugin['file']           = $plugin;
				$git_plugin['local_path']     = WP_PLUGIN_DIR . "/{$header['repo']}/";

				$plugin_data                           = get_plugin_data( WP_PLUGIN_DIR . '/' . $git_plugin['file'] );
				$git_plugin['author']                  = $plugin_data['AuthorName'];
				$git_plugin['name']                    = $plugin_data['Name'];
				$git_plugin['local_version']           = strtolower( $plugin_data['Version'] );
				$git_plugin['sections']['description'] = $plugin_data['Description'];
				$git_plugin['languages']               = $header['languages'];
				$git_plugin['ci_job']                  = $header['ci_job'];
				$git_plugin['release_asset']           = $header['release_asset'];
				$git_plugin['broken']                  = ( empty( $header['owner'] ) || empty( $header['repo'] ) );

				$git_plugin['banners']['high'] =
					file_exists( WP_PLUGIN_DIR . "/{$header['repo']}/assets/banner-1544x500.png" )
						? WP_PLUGIN_URL . "/{$header['repo']}/assets/banner-1544x500.png"
						: null;

				$git_plugin['banners']['low'] =
					file_exists( WP_PLUGIN_DIR . "/{$header['repo']}/assets/banner-772x250.png" )
						? WP_PLUGIN_URL . "/{$header['repo']}/assets/banner-772x250.png"
						: null;

				$git_plugin['icons'] = [];
				$icons               = [
					'svg'    => 'icon.svg',
					'1x_png' => 'icon-128x128.png',
					'1x_jpg' => 'icon-128x128.jpg',
					'2x_png' => 'icon-256x256.png',
					'2x_jpg' => 'icon-256x256.jpg',
				];
				foreach ( $icons as $key => $filename ) {
					$key                         = preg_replace( '/_png|_jpg/', '', $key );
					$git_plugin['icons'][ $key ] = file_exists( $git_plugin['local_path'] . 'assets/' . $filename )
						? WP_PLUGIN_URL . "/{$git_plugin['slug']}/assets/{$filename}"
						: null;
				}
			}

			// Exit if not git hosted plugin.
			if ( empty( $git_plugin ) ) {
				continue;
			}

			$git_plugins[ $git_plugin['slug'] ] = (object) $git_plugin;
		}

		return $git_plugins;
	}
978683
public function getName(): string {
        $meta = $this->getMetadata();
        return (string) $meta->getLiteral(RC::titleProp());
    }
1197789
public function getDescription(): string
    {
        if (\is_array($this->haystack)) {
            $haystack = implode(', ', $this->haystack);
        } else {
            $haystack = $this->haystack;
        }
        return __('must be in "%s"', $haystack);
    }
316411
def get_meta_content(self, metaName):
        
        meta = self.parser.css_select(self.article.doc, metaName)
        content = None

        if meta is not None and len(meta) > 0:
            content = self.parser.getAttribute(meta[0], 'content')

        if content:
            return content.strip()

        return ''
321737
public function getDescription()
    {
        $nodes = $this->html->findTags('meta');
        foreach ($nodes as $node) {
            if (strtolower($node->getAttribute('name')) == 'description') {
                return trim($node->getAttribute('content'));
            }
        }

        return null;
    }