Skip to content

refactored: trademark validation methods to unify trademark checks for names and slugs#1034

Closed
SteveJonesDev wants to merge 5 commits intoWordPress:trunkfrom
SteveJonesDev:stevejonesdev/no-issue/trademark-check-word-boundaries
Closed

refactored: trademark validation methods to unify trademark checks for names and slugs#1034
SteveJonesDev wants to merge 5 commits intoWordPress:trunkfrom
SteveJonesDev:stevejonesdev/no-issue/trademark-check-word-boundaries

Conversation

@SteveJonesDev
Copy link

This pull request refactors the trademark checking logic for plugin names and slugs to improve accuracy and code maintainability. The main change is the introduction of a generalized has_trademark method, which replaces the previous slug-specific logic and adds word boundary checks for plugin names to reduce false positives like. For example the current version of the plugin flags the acronym WCAG for the use of WC. Helper methods have also been added for clarity and future extensibility.

Trademark checking logic improvements:

  • Introduced a new has_trademark method that checks for trademarked terms in both plugin names and slugs, with an option to use word boundaries for names to avoid false positives.
  • Updated validate_name_has_no_trademarks and validate_slug_has_no_trademarks to use the new has_trademark method, passing the appropriate word boundary flag for each case [1] [2].

Code organization and maintainability:

  • Added helper methods has_trademarked_slug and has_trademarked_name that delegate to has_trademark with the correct parameters, improving code readability and future extensibility.
  • Updated method and docblock names to reflect the more generalized trademark checking and new versioning.

@github-actions
Copy link

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: SteveJonesDev <[email protected]>

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

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 this pull request may close these issues.

1 participant

Comments