{"id":23387253,"url":"https://github.com/wp-forge/worker-wp-github-release-api","last_synced_at":"2025-08-10T15:04:47.778Z","repository":{"id":150130451,"uuid":"393357250","full_name":"wp-forge/worker-wp-github-release-api","owner":"wp-forge","description":"Converts the GitHub release API into a WordPress compatible plugin/theme update API accessible via Cloudflare Workers.","archived":false,"fork":false,"pushed_at":"2021-08-06T19:16:39.000Z","size":22,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T05:09:17.195Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wp-forge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-06T11:32:27.000Z","updated_at":"2024-10-17T00:22:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8770746-939b-45f5-8622-c8a8a3b4ca21","html_url":"https://github.com/wp-forge/worker-wp-github-release-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wp-forge/worker-wp-github-release-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-forge%2Fworker-wp-github-release-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-forge%2Fworker-wp-github-release-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-forge%2Fworker-wp-github-release-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-forge%2Fworker-wp-github-release-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-forge","download_url":"https://codeload.github.com/wp-forge/worker-wp-github-release-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-forge%2Fworker-wp-github-release-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269740224,"owners_count":24467751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-22T01:15:24.185Z","updated_at":"2025-08-10T15:04:47.769Z","avatar_url":"https://github.com/wp-forge.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress GitHub Release API\n\nA Cloudflare Worker that provides a REST API for WordPress plugin and theme data. Most commonly, this API is used to manage custom plugin and theme updates in WordPress.\n\nAll data is fetched from GitHub directly and makes a few assumptions:\n\n- Your WordPress plugin or theme lives in a public or private GitHub repository.\n- You've created at least one [release](https://docs.github.com/en/github/administering-a-repository/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release) on GitHub.\n- Your releases contain a `.zip` artifact that is used for the plugin or theme installation.\n\n## Prerequisites\n\n- Sign up for a [Cloudflare Workers account](https://dash.cloudflare.com/sign-up/workers).\n- Install [Node and NPM](https://nodejs.org/en/download/).\n- Install the [Wrangler CLI](https://developers.cloudflare.com/workers/cli-wrangler/install-update) by running `npm \n  i -g @cloudflare/wrangler`.\n- Run `wrangler login` to link the Wrangler CLI to your Cloudflare account.\n\n## Installation\n\n- Run `git clone git@github.com:wp-forge/worker-wp-github-release-api.git` to clone the repository.\n- Run `cp wrangler.example.toml wrangler.toml` to create your own `wrangler.toml` file.\n- Run `wrangler whoami` to get your Cloudflare Account ID.\n- Set your Cloudflare Account ID as `account_id` in the `wrangler.toml` file.\n- Set your GitHub username as `GITHUB_USER` in the `wrangler.toml` file.\n- Run `wrangler publish` to deploy the Worker to Cloudflare.\n- Create a [personal access token](https://github.com/settings/tokens) on GitHub (don't set an expiration and only\n  check the `repo` permissions).\n- Run `wrangler secret put GITHUB_TOKEN` to set your GitHub token as an environmental secret on Cloudflare.\n\nIf you want to configure a custom route via the `wrangler.toml` file, you will need to provide your Cloudflare Zone \nID as `zone_id` in the `wrangler.toml` file.\n\n## Usage\n\nOnce installed, you should be able to access the API at `https://wp-github-release-api.\u003cyour-subdomain\u003e.workers.dev`.\n\nIf you prefer to have the API live on a custom domain, follow the steps on setting up a [custom route](https://developers.cloudflare.com/workers/platform/routes) for your \nCloudflare Worker.\n\nRequests to the API use the following pattern: `/:entity/:vendor:/:package/[:version]/[download]`.\n\n**Plugin Requests**\n```shell\n# Get plugin info for latest version\n/plugins/:vendor/:package\n\n# Get plugin data for specific version\n/plugins/:vendor/:package/:version\n\n# Download latest plugin version\n/plugins/:vendor/:package/download\n\n# Download specific plugin version\n/plugins/:vendor/:package/:version/download\n```\n\n**Theme Requests**\n```shell\n# Get theme info for latest version\n/themes/:vendor/:package\n\n# Get theme data for specific version\n/themes/:vendor/:package/:version\n\n# Download latest theme version\n/themes/:vendor/:package/download\n\n# Download specific theme version\n/themes/:vendor/:package/:version/download\n```\n\nRequired path parameters:\n\n- **entity** - The entity type. Can be either `plugin`, `plugins`, `theme` or `themes`.\n- **vendor** - This is the GitHub username or organization name where the repository is located.\n- **package** - This is the slug of the GitHub repository name.\n\nOptional path parameters:\n\n- **version** - The plugin or theme version number. When absent, the latest version will be returned. When present, \n  the requested version will be returned.\n- **download** - When appended to the URL path, this will trigger a download of the plugin or theme `.zip` file.\n\nOptional query parameters:\n\n- **slug** - The folder name of the plugin or theme. Allows you to override your plugin or theme slug if it is \n  different from the package name.\n- **file** - The file containing the WordPress plugin headers. Only required for plugin requests, this allows you to \n  override the main plugin file name if it doesn't match the expected pattern: `{package}.php`.\n\n### Plugin Request Example\n\n#### Request\n```shell\n/plugins/wpscholar-wp-plugins/shortcode-scrubber\n\n# OR\n\n/plugins/wpscholar-wp-plugins/shortcode-scrubber/1.0.3\n```\n\nIn this scenario, the plugin basename is assumed to be `shortcode-scrubber/shortcode-scrubber.php`. This is derived \nfrom the provided `slug` and `file` query parameters, if provided. Otherwise, the slug is assumed to match the \n`package` name and the `file` is assumed to match the `{package}.php` pattern.\n\n```text\n/plugins/wpscholar-wp-plugins/shortcode-scrubber?slug=shortcode-scrubber-pro\u0026file=scrubber.php\n```\n\nThe example above would result in the following plugin basename: `shortcode-scrubber-pro/scrubber.php`. \n\n#### Response\n```json\n{\n  \"name\": \"Shortcode Scrubber\",\n  \"type\": \"plugin\",\n  \"version\": {\n    \"current\": \"1.0.3\",\n    \"latest\": \"1.0.3\"\n  },\n  \"description\": \"A powerful tool for cleaning up shortcodes on your site and confidently managing plugins and themes that use shortcodes.\",\n  \"author\": {\n    \"name\": \"Micah Wood\",\n    \"url\": \"https://wpscholar.com\"\n  },\n  \"updated\": \"2020-05-11T22:23:45Z\",\n  \"slug\": \"shortcode-scrubber\",\n  \"basename\": \"shortcode-scrubber/shortcode-scrubber.php\",\n  \"url\": \"https://wpscholar.com/wordpress-plugins/shortcode-scrubber/\",\n  \"download\": \"https://github.com/wpscholar-wp-plugins/shortcode-scrubber/releases/download/1.0.3/shortcode-scrubber.zip\",\n  \"requires\": {\n    \"wp\": \"3.2\",\n    \"php\": \"5.6\"\n  },\n  \"tested\": {\n    \"wp\": \"\"\n  }\n}\n```\n\n### Theme Request Example\n\n#### Request\n```shell\n/themes/wpscholar/block-theme\n\n# OR\n\n/themes/wpscholar/block-theme/1.0\n```\n\n#### Response\n```json\n{\n  \"name\": \"Block Theme\",\n  \"type\": \"theme\",\n  \"version\": {\n    \"current\": \"1.0\",\n    \"latest\": \"1.0\"\n  },\n  \"description\": \"A block theme experiment\",\n  \"author\": {\n    \"name\": \"Micah Wood\",\n    \"url\": \"https://wpscholar.com\"\n  },\n  \"updated\": \"2021-08-06T13:27:23Z\",\n  \"slug\": \"block-theme\",\n  \"url\": \"\",\n  \"download\": \"https://github.com/wpscholar/block-theme/releases/download/1.0/block-theme.zip\",\n  \"requires\": {\n    \"wp\": \"\",\n    \"php\": \"\"\n  },\n  \"tested\": {\n    \"wp\": \"\"\n  }\n}\n```\n\n## How to Setup Automated Deployments *(only required if editing code)*\n\n- Install the [GitHub CLI](https://github.com/cli/cli#installation). Mac users can simply run `brew install gh` if\n  [Homebrew](https://brew.sh/) is installed.\n- [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repository into your own GitHub account.\n- Clone your new repository onto your local machine.\n- Run `npm install` from the project root to install dependencies.\n- Create an [API Token](https://dash.cloudflare.com/profile/api-tokens) on Cloudflare using the `Cloudflare Workers` \n  template.\n- Run `gh secret set CLOUDFLARE_API_TOKEN` to set your Cloudflare API key as a secret on GitHub.\n- Run `wrangler whoami` to get your Cloudflare Account ID.\n- Run `gh secret set CLOUDFLARE_ACCOUNT_ID` to set your Cloudflare Account ID as a secret on GitHub.\n- Run `gh secret set GH_USER` to set your GitHub user as a secret on GitHub.\n- Optionally, set your Cloudflare Zone ID by running `gh secret set CLOUDFLARE_ZONE_ID`.\n- Run `wrangler publish` to deploy the Worker to Cloudflare. This must be done once initially so that the secret we \n  set next has an existing Worker to be applied to.\n- Create a [personal access token](https://github.com/settings/tokens) on GitHub (don't set an expiration and only \n  check the `repo` permissions).\n- Run `wrangler secret put GITHUB_TOKEN` to set your GitHub token as an environmental secret on Cloudflare.\n\nAny push to the `master` branch on your GitHub repo will trigger the `.github/workflows/deploy-cloudflare-worker.yml` \nworkflow via GitHub Actions and deploy your Worker to Cloudflare automatically. If you use a different default branch, \nsuch as `main`, simply update the `deploy-cloudflare-worker.yml` file to reflect the correct branch name.\n\n## Additional Notes\n\n- If certain bits of data are missing from the response, it could be that you haven't added all of the necessary \n  file headers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-forge%2Fworker-wp-github-release-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-forge%2Fworker-wp-github-release-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-forge%2Fworker-wp-github-release-api/lists"}