Finish repo configurations (Step 3)#152
Open
milindmore22 wants to merge 1 commit into
Open
Conversation
…taged config, and document multi-environment setup
milindmore22
marked this pull request as ready for review
July 7, 2026 07:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR updates project documentation, improves developer tooling, and introduces a bug fix for origin and port comparison in REST API permission checks.
Why
The previous REST API permission checks did not adequately handle environments using different ports on the same host (e.g.,
localhost:8888vs.localhost:8890), which caused issues in local development environments. Additionally, the developer workflow needed clearer instructions and automated pre-commit checks to improve code quality and onboarding.Related Issue(s):
Covers Step 3 : https://github.com/rtCamp/OnePress/issues/78
Step 1 : #149
How
REST API Permission Validation:
Updated
is_url_from_hostinAbstract_REST_Controller.phpto accept an optional port parameter, ensuring both host and port are compared.Changed visibility of
is_url_from_hostfrom private to protected.Updated
check_api_permissionsto pass the port when callingis_url_from_hostto improve security and correctness.Developer Documentation:
Updated
AGENTS.mdwith instructions for local development usingwp-env, including parallel environment setup, explicit CLI commands, and documentation for running pre-commit hooks with Lefthook andlint-staged.Developer Tooling:
Enabled the pre-commit hook for
lint-stagedin.lefthook.yml.Updated
.lintstagedrc.mjsto wrap filenames in single quotes instead of double quotes for PHP file linting commands to improve compatibility.Testing Instructions
wp-envinstructions inAGENTS.md.localhost:8888andlocalhost:8890) to verify that permission checks evaluate correctly.lint-stagedpre-commit hook triggers automatically and lints the file.Screenshots
N/A
Additional Info
N/A
Checklist