Earn it: GitHub Achievements Academy home

Repo 6: WordPress plugins and themes

WordPress powers a huge share of the web, and its official plugin directory still uses Subversion (SVN), not Git. The good news: you can develop entirely on GitHub and let Actions publish to WordPress.org every time you tag a release.

A repo layout that works

my-plugin/
├── my-plugin.php          main file with the plugin header
├── readme.txt             the WordPress.org listing (not README.md)
├── uninstall.php          cleans up options and tables on delete
├── includes/              PHP classes
├── assets/                the plugin's own CSS, JS and images
├── languages/             translation files
├── .wordpress-org/        directory banners, icons and screenshots (deployed to SVN /assets)
├── .distignore            files that must NOT ship to users
├── composer.json          PHPCS + WordPress Coding Standards
├── README.md              the GitHub page, for developers
└── .github/workflows/
    ├── ci.yml
    └── deploy.yml

Two readmes on purpose: readme.txt uses WordPress's own format (stable tag, tested-up-to, changelog) and powers your directory listing. README.md is for developers on GitHub.

.distignore: keep dev files out of the release

/.git
/.github
/.wordpress-org
/node_modules
/tests
.distignore
.gitignore
composer.json
composer.lock
package.json
package-lock.json
phpcs.xml.dist
README.md

Licensing

Plugins and themes in the WordPress.org directory must be GPL-compatible, and most use GPL-2.0-or-later. Say so in the plugin header, in readme.txt and in a LICENSE file.

CI: coding standards and security checks

Run PHP_CodeSniffer with the WordPress Coding Standards on every PR. They catch escaping, sanitizing and nonce problems before a reviewer does:

name: CI
on: [pull_request, push]
permissions:
  contents: read
jobs:
  phpcs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: shivammathur/setup-php@v2
        with:
          php-version: "8.3"
          tools: composer
      - run: composer install --no-interaction --no-progress
      - run: vendor/bin/phpcs

Also consider running the official Plugin Check plugin before submitting.

The review checklist people fail most

Plugin reviewers reject submissions for the same few things again and again. Before every release, check that:

Deploy to WordPress.org on every release

10up's WordPress.org Plugin Deploy action commits your tagged release to SVN, respecting .distignore:

name: Deploy to WordPress.org
on:
  release:
    types: [published]
permissions:
  contents: write    # to attach the zip to the GitHub release
jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: wordpress-org
    steps:
      - uses: actions/checkout@v7
      - name: WordPress Plugin Deploy
        id: deploy
        uses: 10up/action-wordpress-plugin-deploy@stable
        with:
          generate-zip: true
        env:
          SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
          SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
          SLUG: my-plugin            # only needed if it differs from the repo name
      - name: Attach zip to the GitHub release
        run: gh release upload "${{ github.event.release.tag_name }}" "${{ steps.deploy.outputs.zip-path }}"
        env:
          GH_TOKEN: ${{ github.token }}
  • Store SVN_USERNAME and SVN_PASSWORD as environment secrets on a wordpress-org environment, ideally with yourself as a required reviewer.
  • The Readme/Assets Update action updates readme.txt and banners between releases without a new version.
  • Themes use a similar flow. The WordPress.org theme directory has its own review process and upload steps, so check its current docs.

The release routine

  1. Merge PRs into main, with CI green.
  2. Bump the version in the plugin header and the Stable tag in readme.txt, and add a changelog entry.
  3. Run through the review checklist above.
  4. Publish a GitHub release tagged with the same version (for example 1.4.0).
  5. The deploy workflow updates WordPress.org, and the zip is attached to the GitHub release.

Exercise

  1. Add .distignore, composer.json with WordPress Coding Standards, and the CI workflow to a plugin repo.
  2. Fix whatever PHPCS reports, especially nonces and escaping.
  3. Draft (don't publish) the deploy workflow and add the secrets to a wordpress-org environment.

What you learned

  • A repo layout for plugins and themes, with two readmes on purpose
  • Coding-standard CI and the review checklist that catches common rejections
  • Automatic deploys from GitHub releases to WordPress.org's SVN

Next: Repo 7: Courses, workshops and templates

Check what you learned

1. What does .distignore control?
2. Before release, every handler reading $_POST should…
3. Where do the SVN username and password for the deploy workflow belong?

Show the answers
  1. Which files are left out of the release shipped to users: Dev files like tests, CI config and README.md stay on GitHub, not in the user's download.
  2. Verify a nonce and check the user's permissions: Missing nonce and capability checks are among the most common reasons plugins get flagged in review.
  3. As secrets, ideally on a protected environment: Credentials never go in files. Environment secrets can also require approval before use.

Your progress is saved in this browser only.

Last reviewed November 2026. Improve this page on GitHub. Every fix you send counts toward Pull Shark.