wp/lib/blobfolio/wp/bm/admin.php
protected static function get_local_contributors($slug, $version) {
		// Obviously bad data.
		if (!$slug || !$version || !is_string($slug) || !is_string($version)) {
			return array();
		}

		// Cache this for each plugin/version pair.
		$transient_key = 'bm_local_contrib_' . md5("$slug|$version");
		if (false !== ($contributors = get_transient($transient_key))) {
			return $contributors;
		}

		// The directory in question.
		$dir = trailingslashit(WP_PLUGIN_DIR) . $slug;
		if (!@is_dir($dir)) {
			return array();
		}

		// If the readme file isn't named normally, we have to run
		// through the directory (but just one level).
		if (
			!@is_file("$dir/readme.txt") ||
			(false === ($contributors = static::parse_readme_contributors($slug)))
		) {
			$files = list_files($dir, 1);
			if (is_array($files)) {
				foreach ($files as $file) {
					if (
						preg_match('/^readme\.(txt|md)$/i', basename($file)) &&
						@is_file($file) &&
						(false !== ($contributors = static::parse_readme_contributors($file)))
					) {
						break;
					}
				}
			}
		}

		// Looking good!
		if (is_array($contributors) && count($contributors)) {
			set_transient($transient_key, $contributors, WEEK_IN_SECONDS);
		}
		// We should still cache a negative lookup because if we
		// couldn't get the info this time, we probably won't next time.
		else {
			set_transient($transient_key, array(), WEEK_IN_SECONDS);
		}

		return $contributors;
	}
protected static function get_local_contributors($slug, $version) {
		// Obviously bad data.
		if (!$slug || !$version || !is_string($slug) || !is_string($version)) {
			return array();
		}

		// Cache this for each plugin/version pair.
		$transient_key = 'bm_local_contrib_' . md5("$slug|$version");
		if (false !== ($contributors = get_transient($transient_key))) {
			return $contributors;
		}

		// The directory in question.
		$dir = trailingslashit(WP_PLUGIN_DIR) . $slug;
		if (!@is_dir($dir)) {
			return array();
		}

		// If the readme file isn't named normally, we have to run
		// through the directory (but just one level).
		if (
			!@is_file("$dir/readme.txt") ||
			(false === ($contributors = static::parse_readme_contributors($slug)))
		) {
			$files = list_files($dir, 1);
			if (is_array($files)) {
				foreach ($files as $file) {
					if (
						preg_match('/^readme\.(txt|md)$/i', basename($file)) &&
						@is_file($file) &&
						(false !== ($contributors = static::parse_readme_contributors($file)))
					) {
						break;
					}
				}
			}
		}

		// Looking good!
		if (is_array($contributors) && count($contributors)) {
			set_transient($transient_key, $contributors, WEEK_IN_SECONDS);
		}
		// We should still cache a negative lookup because if we
		// couldn't get the info this time, we probably won't next time.
		else {
			set_transient($transient_key, array(), WEEK_IN_SECONDS);
		}

		return $contributors;
	}
Local Contributors

Try to find and parse installed plugins' readme.txt files for
contributor information.

@param string $slug Plugin slug (index version).
@param string $version Version.
@return array Contributors.