Repository navigation
Find the main plugin file by its header, as WordPress does - #59
Merged
Merged
Conversation
The Composer lock trailed the latest releases. It moves to PHPStan 2.3.4, composer/composer 2.11.0, php-code-coverage 14.5.0, roave/security-advisories and Symfony patch releases; theseer/tokenizer drops out, as no package requires it any more. symfony/filesystem and symfony/finder stay on 7.4, which humbug/php-scoper 0.18 caps. The npm lock stays as it is: under the host's seven-day release-age cooldown, npm update would move 38 packages down, such as @typescript-eslint 8.72.1 to 8.72.0, and none up. No code change was needed. Assisted-by: Claude Code:claude-opus-5-5
The release learns the main plugin file from an entry-file input that defaults to <plugin-slug>.php, and can rename it in the archive through archive-entry-file. No caller passes either input. WordPress needs neither: it reads the first 8 KB of each PHP file at the plugin's root and takes the one with a Plugin Name header. Rows cover a build step that finds the file the same way: one header file, named after the slug or not, is exported as ENTRY_FILE; none, two, one only in a subfolder or one past the first 8 KB fail and name what was found. The required-files rows keep the entry file under its own name, and the rows for both inputs' validation and the rename step go. Assisted-by: Claude Code:claude-opus-5-5
The release took the main plugin file from an entry-file input that defaulted to <plugin-slug>.php, and could ship it under another name through archive-entry-file. Both inputs asked the caller for something the project already says: WordPress takes a plugin's main file to be the PHP file at its root whose first 8 KB carry a Plugin Name header. No caller passes either input, so dropping them now breaks no one. A build step before the version check reads the root's PHP files the same way and exports the one it finds as ENTRY_FILE, which the header, floor and required-files checks read as before; none or several fail the release and name what was found. The inputs, their validation, the rename step and its fallback in the required-files check go, and docs/workflows.md and docs/scripts-contract.md describe the main plugin file as WordPress finds it. The required-files rows take neutral names. Assisted-by: Claude Code:claude-opus-5-5
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.
Summary
The release takes the main plugin file to be the one PHP file at the project root whose first 8 KB carry a
Plugin Nameheader, as WordPress does, so theentry-fileandarchive-entry-fileinputs go.Type of change
.github/workflows/reusable-*.yml)php/quality-assurance/)Checklist
tests/Unit/)composer testpasses locallydocs/workflows.mdis updated to reflect the new contractdev-trunkconsumers immediately)Breaking changes for downstream consumers
reusable-release.ymlno longer declaresentry-fileorarchive-entry-file, so a caller passing either fails at startup. No caller passes them: the plugin template, the only consumer, pins the previous trunk and passes neither, and its pin moves together with the removal of its recipe step that namedarchive-entry-file.A release now fails when the project root holds no PHP file with a
Plugin Nameheader in its first 8 KB, or more than one, including one that.distignoreleaves out of the archive.The branch also refreshes the Composer lock; the npm lock is unchanged.