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

Detect localhost/127.0.0.1 code in multiple files #399

Merged
merged 7 commits into from
Jul 13, 2024

Conversation

ernilambar
Copy link
Member

@ernilambar ernilambar commented Jan 23, 2024

Fixes #362

  • Adds method files_preg_match in Abstract_File_Check to return multiple results matched with given regex.
  • Update Localhost_Check to handle array of results
  • Update Localhost_Check_Tests accordingly

@ernilambar ernilambar force-pushed the 362-multiple-localhost-errors branch from 5614941 to 2e0d302 Compare January 23, 2024 10:02
@ernilambar
Copy link
Member Author

@swissspidy
Copy link
Member

Let's discuss the right approach on the issue first. This applies to other checks as well.

@davidperezgar davidperezgar self-requested a review June 11, 2024 06:09
@davidperezgar davidperezgar added the [Team] Plugin Review Issues owned by Plugin Review Team label Jun 22, 2024
@frantorres frantorres self-requested a review June 22, 2024 14:02
@frantorres
Copy link
Contributor

Thanks for this change, I think that for this check it would be really useful to also give users the line + column where that happens (as well as showing more than one case for file). I mentioned this on #362 .

Also, I can suggest to add other common "localhost" cases like:

  • https?:\/\/(?:[^\s\/]*\.)++local(?:host)? (this covers domains ending in .local and .localhost, for example: docker.local)

@ernilambar ernilambar force-pushed the 362-multiple-localhost-errors branch 2 times, most recently from 5821136 to 112532b Compare June 24, 2024 09:55
@ernilambar ernilambar force-pushed the 362-multiple-localhost-errors branch from 112532b to 3430e85 Compare June 24, 2024 09:59
@ernilambar
Copy link
Member Author

PR has been updated based on feedback.

Copy link

github-actions bot commented Jul 3, 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 <[email protected]>
Co-authored-by: swissspidy <[email protected]>
Co-authored-by: frantorres <[email protected]>

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

@ernilambar ernilambar added this to the 1.1.0 milestone Jul 12, 2024
@swissspidy swissspidy merged commit d3e0f9d into WordPress:trunk Jul 13, 2024
22 checks passed
@ernilambar ernilambar deleted the 362-multiple-localhost-errors branch July 15, 2024 04:37
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Localhost check does not show errors in multiple files
4 participants