paths[] = $path; } /** * Local plugins are already included (downloaded) in the zip file. * Return the full path. * * @param string $slug The slug of the plugin to be downloaded. * * @return string|null */ public function download( $slug ): ?string { foreach ( $this->paths as $path ) { $full_path = $path . "/{$this->suffix}/" . $slug . '.zip'; if ( is_file( $full_path ) ) { return $full_path; } } return null; } /** * Get the supported resource. * * @return string The supported resource. */ public function get_supported_resource(): string { return 'self/plugins'; } }