Skip to content

2.17.4 — a same-version self-update is refused before anything changes

Choose a tag to compare

@BenKalsky BenKalsky released this 16 Sep 12:51
c8592d7

This release guards the site against being sent the version it already runs. Aura's side of the same bug is fixed in Digitizers/Aura#551: the rollout now checks the site's live version before it sends anything. This release covers what is left, a site that WordPress auto-updates between that check and the send.

What ships

  • A same-version self-update is refused before anything changes (#104). The sha256-verified download is inspected in place with ZipArchive, reading only the main file's Version: header and AURA_WORKER_VERSION define. If either names the running version, the request is refused with code: aura_self_update_same_version. No backup is taken, no install runs, the live directory is left alone, and the temporary download is deleted.

    Until now the check ran only after the backup and the install, so every refused request reinstalled and restored the plugin. On one WP Engine site each such run lost readme.txt (#95).

    If ZipArchive is missing, the archive cannot be opened, or the main file is not at the expected path, the request goes through the old path.

  • The post-install check says what the evidence supports.

    • aura_self_update_not_replaced: the verified archive carries a different version, yet the old version is still on disk, so the upgrader did not replace the directory.
    • aura_self_update_version_unchanged: there is no such proof, and the message names both possible causes.
  • A failed restore reports which stage failed (clear or extract). A failed clear can delete some files before it stops, so the message now reports what the main file reads instead of calling the directory untouched.

Verification

  • 2344 PHPUnit tests pass on PHP 7.4, 8.1 and 8.2. PHPCS, Plugin Check and CodeQL are clean.
  • #105 went through Codex review until it was clean. Each fix was checked by confirming its test fails without it: seven tests failed against the old code.
  • #106, the version bump, had two clean Codex rounds on the same commit.

readme.txt's Changelog has 11 words of headroom. The next release must first move the oldest entries into docs/changelog-archive.md.

Implementation: #105. Release: #106.