Skip to content

Add the running of Plugin Check back to our helper files#1028

Merged
jeffpaul merged 3 commits intodevelopfrom
fix/plugin-check-errors
Jan 12, 2026
Merged

Add the running of Plugin Check back to our helper files#1028
jeffpaul merged 3 commits intodevelopfrom
fix/plugin-check-errors

Conversation

@dkotter
Copy link
Copy Markdown
Collaborator

@dkotter dkotter commented Jan 12, 2026

Description of the Change

Coming out of #1023, we removed the scanning of our helper files from Plugin Check as it wanted us to add a code snippet to prevent direct file access but this caused issues with PHPCS. After doing some more digging, found that when PHPCS is run, it will load your composer autoload file and this in turn will load any files you are directly loading via composer (as opposed to loading via psr-4). We do this for our helper files and so when you add an exit statement to these files, this stops PHPCS from running.

There are a few fixes for this but seemed the easiest was to change from using exit to using return so that's what I've done in this PR. In addition, noticed a few PHPCS warnings around the use of heredoc instead of nowdoc so fixed those up as well.

How to test the Change

Nothing really needed other than ensuring Plugin Check passes and PHPCS also passes

Note

E2E tests aren't working on WP trunk, assuming due to upstream issues

Changelog Entry

Fixed - Ensure our helper files don't allow direct file access

Credits

Props @dkotter

Checklist:

@dkotter dkotter added this to the 3.8.0 milestone Jan 12, 2026
@dkotter dkotter self-assigned this Jan 12, 2026
@dkotter dkotter requested review from a team and jeffpaul as code owners January 12, 2026 21:16
@github-actions github-actions bot added the needs:code-review This requires code review. label Jan 12, 2026
@dkotter dkotter changed the title Add back Plugin Check to our helper files Add the running of Plugin Check back to our helper files Jan 12, 2026
@jeffpaul jeffpaul merged commit c51acbc into develop Jan 12, 2026
18 of 23 checks passed
@jeffpaul jeffpaul deleted the fix/plugin-check-errors branch January 12, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:code-review This requires code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants