-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add replacing of images only in frontend context #424
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
50eaf8e
Add replacing of images only in frontend context
akshitsethi 6a2e8b0
Check if the request made is inside wp_head hook
akshitsethi 41ed9a3
Add tests to verify request check for frontend context
akshitsethi 2655c7f
Implement PR suggestions
akshitsethi 08ab74e
Merge branch 'trunk' into fix/379-replace-content-images-frontend
felixarntz 14e1a0e
Revised logic for webp_uploads_in_frontend_body() and added more test…
felixarntz 510e07b
Run necessary hooks to mock frontend body for relevant content replac…
felixarntz 10e9fbe
Remove condition for whether wp_head was run to satisfy FSE.
felixarntz File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of nit-pick here but the test function names are different than what we actually use the names here like
it_should
orit_
like that. And these functions doesn't have function doc comment.cc: @felixarntz @akshitsethi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehulkaklotar I didn't think it was too critical to point it out in earlier tests for the plugin, but the convention for WordPress core tests is to always use
test_
followed by the function name, then optionally anything else. So I stuck with that here.I would advise to follow that convention for future tests to monitor the core plan.
Regarding doc comments, test methods do not require any doc comments per core specifications - only when helpful. Preferably, the name of the method should be clear enough to know what is going on, or when it makes sense to clarify specific code, inline comments should be used.
cc @akshitsethi @adamsilverstein @mukeshpanchal27 @jjgrainger @eugene-manuilov