Repository navigation
WordPress: コアのバージョン照合の結果を必ずログに出す - #5
Merged
Merged
Conversation
#4 で入れた照合は判定が通ったとき無言だったため、チェックが走ったのかログから 確認できなかった。version.php の書式変更などで抽出が失敗した場合も、空文字のまま 黙って素通りしてしまい、実質無効化されていることに気づけない。 判定結果を必ず1行出すようにし、リポジトリ側の抽出に失敗したケースの分岐も追加した。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
#4 で入れたコアのバージョン照合は、判定が通ったとき無言だった。
そのため次の問題がある。
version.phpの書式が変わるなどしてバージョン抽出に失敗した場合、remote_verが空文字のまま黙って素通りする。安全側の設計ではあるが、実質無効化されていることに気づけないセキュリティのための仕組みが静かに壊れているのが最も避けたい状態なので、結果を必ず可視化する。
変更内容
判定結果を必ず1行ログに出すようにした。あわせて、リポジトリ側の抽出に失敗したケースの分岐を追加した。
- WP core version -> OK (server: 7.0.2 / repo: 7.0.2)- WP core version -> OK (server: 7.0.1 -> repo: 7.0.2 に更新します)- WP core version -> skipped (サーバ側の version.php を取得できませんでした / repo: 7.0.2)- WP core version -> skipped (リポジトリの version.php からバージョンを取得できませんでした)実際のデプロイログはこう見える。
before_syncは改行なし(echo -n)でログ出力中のため、出力前に改行を入れている。動作確認
bash -nで構文チェック済み