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

PHPCS Improvement #1122

Closed
wants to merge 1 commit into from
Closed

Conversation

Chintesh
Copy link
Contributor

Summary

Fixes #

Relevant technical choices

I've refactored the code to address PHPCS (PHP CodeSniffer) warnings and improve code readability and standards compliance.

  • Used isset() to check if a variable is set before accessing it to avoid illegal string offset warnings.
  • Replaced strpos() with str_contains() for more readable string containment checks.
  • Utilized filter_input() with appropriate sanitization for better handling of input data from superglobals.
  • Ensured that all global variables like $_SERVER are properly validated before use to prevent potential security vulnerabilities.

These changes aim to enhance the overall quality and maintainability of the codebase by adhering to best practices recommended by PHPCS.

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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @chinteshprajapati.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: chinteshprajapati.


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

@Chintesh Chintesh closed this Apr 11, 2024
@Chintesh Chintesh deleted the enhancement/phpcs branch April 11, 2024 17:26
@Chintesh Chintesh restored the enhancement/phpcs branch April 11, 2024 17:26
@Chintesh Chintesh deleted the enhancement/phpcs branch April 11, 2024 17:26
@Chintesh Chintesh restored the enhancement/phpcs branch April 11, 2024 17:26
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.

2 participants