-
Notifications
You must be signed in to change notification settings - Fork 152
feat: Add SEO Settings module for WP User Frontend #1710
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.
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.
Security risk: Use WordPress HTTP API instead of
file_get_contents().You shouldn't use
file_get_contents()for remote requests. WordPress does the heavy lifting for you when determining what is compatible on your host. Instead offile_get_contents()usewp_remote_get(). The issue here is thatfile_get_contentswill fetch remote pages but doesn't check on the integrity of the HTTPS protocol connection. This could potentially be a victim of a man-in-the-middle attack. In WordPress, it's even easier: usewp_remote_get. It works much more consistently thanfile_get_contents, and it'll default to verifying SSL connections.However, since this is a local file read (crown icon SVG), the security concerns are minimal. For local file access, you should use
$wp_filesystem->get_contents(), and that method simply calls the native PHP'sfile_get_contents(), so you may use it directly in your code - for reading local files/resources.Based on web search results
Apply this diff to use WordPress filesystem API:
Then add this helper method to the class:
🧰 Tools
🪛 GitHub Check: Run PHPCS inspection
[warning] 228-228:
file_get_contents() is discouraged. Use wp_remote_get() for remote URLs instead.
🤖 Prompt for AI Agents