> For the complete documentation index, see [llms.txt](https://whoisandywhite.gitbook.io/porterwp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whoisandywhite.gitbook.io/porterwp/tooling/release-process.md). Agents can also search and read this documentation through its [MCP server](https://whoisandywhite.gitbook.io/porterwp/~gitbook/mcp).

# Release builds

PorterWP's source repository contains translation catalogs, development files, and a deterministic ZIP builder. Release artifacts contain the runtime plugin under the stable `porterwp-premium/` directory.

## Current release metadata

| Field                | PorterWP 1.4.101 |
| -------------------- | ---------------- |
| Plugin version       | `1.4.101`        |
| WordPress minimum    | `6.4`            |
| Tested through       | `7.1`            |
| PHP minimum          | `8.2`            |
| License              | GPL v3 or later  |
| Text domain          | `porterwp`       |
| Bundled Freemius SDK | `2.13.5`         |

The authoritative plugin header and runtime constant are in `porter.php`. WordPress.org-style release metadata and the historical changelog are in `readme.txt`. The root `LICENSE` contains the complete GPLv3 license text.

## Version checklist

For a new PorterWP release, update these values together:

1. `Version` in the `porter.php` plugin header;
2. the `PORTER_VERSION` constant in `Porter_WP::initialize()`;
3. `Stable tag` in `readme.txt`;
4. the new top entry in the `readme.txt` changelog;
5. `Project-Id-Version` in the POT and PO headers after regenerating catalogs;
6. `Tested up to`, minimum WordPress, PHP, and license metadata when those compatibility statements change.

Plugin-owned block styles and scripts use `PORTER_VERSION` for cache busting, so the header and constant must not drift.

## Translations

PorterWP registers its text domain at `init` priority 1 and loads bundled translations from `/lang`. Loading at `init` avoids early-translation warnings while remaining compatible with WordPress 6.4 and later.

Source catalogs follow WordPress locale names:

```
lang/porterwp.pot
lang/porterwp-ar.po
lang/porterwp-es_ES.po
lang/porterwp-fr_FR.po
lang/porterwp-id_ID.po
lang/porterwp-ru_RU.po
lang/porterwp-zh_CN.po
```

Each PO has a corresponding compiled MO with the same locale suffix. Runtime ZIPs include the MO files; the development-only PO and POT files are excluded.

From the plugin source root, regenerate the template with WP-CLI:

```bash
wp i18n make-pot . lang/porterwp.pot \
  --domain=porterwp \
  --exclude=includes/vendor,lang,bin
```

Merge each translation and compile its runtime catalog using GNU gettext:

```bash
for po_file in lang/porterwp-*.po; do
  msgmerge --update --backup=none "$po_file" lang/porterwp.pot
  locale="${po_file#lang/porterwp-}"
  locale="${locale%.po}"
  msgfmt --check -o "lang/porterwp-${locale}.mo" "$po_file"
done
```

Review new and fuzzy messages with a translator before release. Compilation success confirms catalog syntax; it does not confirm translation quality.

## Deterministic ZIP builder

Run the source-only builder from the plugin root:

```bash
bash bin/build-release.sh
```

It reads the version from the `porter.php` header and writes the default artifact alongside the plugin directory:

```
porterwp-premium-1.4.101.zip
```

Pass an explicit destination when required:

```bash
bash bin/build-release.sh /absolute/path/to/porterwp-premium-1.4.101.zip
```

An existing file at that exact destination is replaced after a successful build.

The archive builder:

* stages the plugin in a guarded temporary directory;
* stores files beneath `porterwp-premium/`;
* sorts the archive input;
* normalizes file timestamps to a fixed UTC value;
* strips extra ZIP metadata;
* cleans its guarded temporary directory on exit.

For an unchanged source tree, repeated builds are byte-for-byte reproducible.

### Files excluded from the runtime ZIP

* Git, GitHub, IDE, and editor metadata;
* `bin/`, `tests/`, and `node_modules/`;
* Composer manifests and PHPCS/PHPUnit configuration;
* Markdown, source maps, PO, POT, and SCSS source files;
* operating-system metadata such as `.DS_Store` and `__MACOSX`.

Runtime PHP, compiled JavaScript and CSS, JSON, MO files, `readme.txt`, and the extensionless root `LICENSE` remain in the artifact. The builder itself is excluded because it is a source-development tool, not a runtime dependency.

## Reproducibility check

Build twice into a dedicated temporary directory and compare the results:

```bash
release_check_dir="$(mktemp -d "${TMPDIR:-/tmp}/porterwp-release-check.XXXXXX")"

bash bin/build-release.sh "$release_check_dir/porterwp-one.zip"
bash bin/build-release.sh "$release_check_dir/porterwp-two.zip"

shasum -a 256 "$release_check_dir/porterwp-one.zip" "$release_check_dir/porterwp-two.zip"
cmp "$release_check_dir/porterwp-one.zip" "$release_check_dir/porterwp-two.zip"
unzip -l "$release_check_dir/porterwp-one.zip"
```

Matching hashes and a successful `cmp` confirm reproducibility. Inspect the file listing before publishing and remove the dedicated temporary directory after the check.

## Pre-release validation

At minimum:

1. Lint all first-party and vendored PHP with supported PHP versions.
2. Syntax-check first-party JavaScript and shell scripts.
3. Parse every JSON file.
4. Run `msgfmt --check` for every PO catalog.
5. Run `git diff --check`.
6. Build twice and compare artifact hashes.
7. Activate the built ZIP, not only the source checkout, on representative WordPress sites.

Runtime QA should cover:

* WordPress 6.4 or later and an exact WordPress 7.1 installation;
* PHP 8.2 or later, including the currently deployed PHP branches;
* front-end requests, wp-admin, REST, cron registration, and deactivation;
* a site with ACF PRO and a site where its required APIs are unavailable;
* custom post types, taxonomies, Porter block discovery, and theme PHP includes;
* premium filters, including an existing legacy theme template;
* `Porter_QueryFilter_Base` and `Porter_PastStatusUpdater` subclasses;
* Site Editor collection and individual editing screens.

Restore each QA site's original plugin copy and running state when testing against an existing local installation.

## Publishing handoff

Before tagging or uploading the ZIP:

* confirm the working tree contains only intentional release changes;
* confirm the changelog describes security, compatibility, behavior, and migration-impacting changes without exposing secrets;
* record the final artifact hash;
* retain the source commit used to build it;
* verify the plugin header, `readme.txt`, runtime constant, POT, and GitBook all name the same release and compatibility range.
