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

Update severity for i18n codes #844

Merged
merged 2 commits into from
Dec 26, 2024
Merged

Update severity for i18n codes #844

merged 2 commits into from
Dec 26, 2024

Conversation

ernilambar
Copy link
Member

@ernilambar ernilambar commented Dec 24, 2024

Regarding i18n improvement for the plugins, PRT team has decided to raise some WordPress.WP.I18n error codes to severity 7 making those blockers in the WP.org. As first step, following codes are made severity 7. These are pretty robust checks and irrespective of plugin text domain.

  • WordPress.WP.I18n.InterpolatedVariableDomain
  • WordPress.WP.I18n.MissingArgText
  • WordPress.WP.I18n.NoEmptyStrings
  • WordPress.WP.I18n.NonSingularStringLiteralContext
  • WordPress.WP.I18n.NonSingularStringLiteralDomain
  • WordPress.WP.I18n.TooManyFunctionArgs

Feature test scenario has also been added for new severity level.

Example errors which will be triggered as blockers:

      esc_html_e( 'Hello world', "${var}" );
      esc_html_e( domain: 'foo-sample' );
      esc_html_e( '%s', 'foo-sample' );
      echo esc_html_x( 'Hello world', $var, 'foo-sample' );
      esc_html_e( 'Hello world', $var );
      esc_html_e( 'Hello world', 'foo-sample', 'too-many-args' );

@ernilambar ernilambar added [Type] Enhancement A suggestion for improvement of an existing feature [Team] Plugin Review Issues owned by Plugin Review Team labels Dec 24, 2024
@ernilambar ernilambar added this to the 1.4.0 milestone Dec 24, 2024
@ernilambar ernilambar marked this pull request as ready for review December 24, 2024 10:24
Copy link

github-actions bot commented Dec 24, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ernilambar <rabmalin@git.wordpress.org>
Co-authored-by: davidperezgar <davidperez@git.wordpress.org>
Co-authored-by: frantorres <frantorres@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ernilambar ernilambar merged commit 6edfb9d into trunk Dec 26, 2024
30 checks passed
@ernilambar ernilambar deleted the i18n-raise-errors branch December 26, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Team] Plugin Review Issues owned by Plugin Review Team [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants