Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YoastCS: add extra WP related rules #365

Merged
merged 2 commits into from
Dec 14, 2023
Merged

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Dec 14, 2023

Composer: add Automattic VIP sniffs requirement

YoastCS rules: add a few VIP sniffs to prevent some typical WP compat bugs

There is one known bug in the WordPressVIPMinimum.Hooks.AlwaysReturnInFilter sniff related to a redirect being done from within the filter.
This has been reported upstream Automattic/VIP-Coding-Standards#719.

Related to #303

Fixes #229

Impact on Yoast packages:

Plugin/Tool Errors/Warnings
PHPUnit Polyfills --
WP Test Utils --
YoastCS --
WHIP --
Yoast Test Helper --
Duplicate Post --
Yst ACF --
Yst WooCommerce --
Yst News --
Yst Local 2 (proper escaping)
Yst Video --
Yst Premium 1 (false positive/reported bug)
Yst Free 2 (1 false positive/reported bug)

Note: these rules were previously already "silently" enforced via clean-up sweeps.

… bugs

There  is one known bug in the `WordPressVIPMinimum.Hooks.AlwaysReturnInFilter` sniff related to a redirect being done from within the filter.
This has been reported upstream Automattic/VIP-Coding-Standards 719.

Related to 303

Fixes 229

Impact on Yoast packages:

| Plugin/Tool       | Errors/Warnings |
|-------------------|-----------------|
| PHPUnit Polyfills | --
| WP Test Utils     | --
| YoastCS           | --
| WHIP              | --
| Yoast Test Helper | --
| Duplicate Post    | --
| Yst ACF           | --
| Yst WooCommerce   | --
| Yst News          | --
| Yst Local         | 2 (proper escaping)
| Yst Video         | --
| Yst Premium       | 1 (false positive/reported bug)
| Yst Free          | 2  (1 false positive/reported bug)

Note: these rules were previously already "silently" enforced via clean-up sweeps.
@coveralls
Copy link

Coverage Status

coverage: 99.411%. remained the same
when pulling 44c961f on JRF/yoastcs-wp-related-rules
into f209bca on develop.

@jrfnl jrfnl merged commit 1f0f6a7 into develop Dec 14, 2023
28 checks passed
@jrfnl jrfnl deleted the JRF/yoastcs-wp-related-rules branch December 14, 2023 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filters should always return the first argument
2 participants