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

switch_to_blog: Change message to reflect WordPress-VIP-Go ruleset and downgrade to "Warning" #643

Closed
rebeccahum opened this issue Mar 29, 2021 · 3 comments · Fixed by #649
Milestone

Comments

@rebeccahum
Copy link
Contributor

rebeccahum commented Mar 29, 2021

This is a two-part issue since I think step #2 will need to be done in 3.x due to it being a breaking change (can you please confirm @jrfnl?)

Step 1
Mentioned in #615, we should change the message in the WordPressVIPMinimum.Functions.RestrictedFunctions.switch_to_blog_switch_to_blog error code to reflect the one being changed in WordPress-VIP-Go since the current one is outdated.

From:

'message' => '%s() is not something you should ever need to do in a VIP theme context. Instead use an API (XML-RPC, REST) to interact with other sites if needed.',

To:

<message>Switch to blog may not work as expected since it only changes the database context for the blog and does not load the plugins or theme of that site. This means that filters or hooks that the blog you are switching to uses will not run.</message>

Step 2
Downgrade to warning type at sniff level and remove modification in WordPress-VIP-Go ruleset:

@jrfnl
Copy link
Collaborator

jrfnl commented Apr 14, 2021

@rebeccahum Neither of these changes is a breaking change as custom rulesets and ignore annotations don't filter on error/warning, just on sniff name or error code.

In other words, if you'd like to adjust PR #649, that should be fine to go into 2.3.0 still.

@jrfnl jrfnl added this to the 2.3.0 milestone Apr 14, 2021
@GaryJones
Copy link
Contributor

If something bumped up from a warning to an error, then we may want to consider that to be a breaking change, as it could break builds.

@jrfnl
Copy link
Collaborator

jrfnl commented Apr 15, 2021

@GaryJones Good point and I agree that's very true from a functional point of view.

In this particular case, however, we're talking bumping down to a warning.

On top of that, the bumping down would only affect people who selectively include sniffs or use the WordPressVIPMinimum ruleset. The WordPress-VIP-Go ruleset users are not affected as the rule in question was already a warning for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants