Skip to content

fix: add PHPCS inline directives for WordPress Plugin Check compatibility#10

Merged
alihesari merged 1 commit intomainfrom
fix/phpcs-wordpress-plugin-check-compatibility
Mar 7, 2026
Merged

fix: add PHPCS inline directives for WordPress Plugin Check compatibility#10
alihesari merged 1 commit intomainfrom
fix/phpcs-wordpress-plugin-check-compatibility

Conversation

@alihesari
Copy link
Member

Summary

Added phpcs:disable comments to all source, example, and test files so the library passes WordPress coding standards when bundled as a vendor dependency inside WordPress plugins via WordPress Plugin Check.

Problem

When owlstack-core is installed as a Composer dependency in owlstack-wp, WordPress Plugin Check scans the vendor files against WordPress Coding Standards. Since this is a framework-agnostic library that intentionally uses native PHP functions (cURL, json_encode, file_get_contents, base64_encode, etc.), it triggers 134 errors and 52 warnings across 16 source files, plus 239 errors and 39 warnings across 27 example files, and 125 warnings across 11 test files.

Solution

Added file-level phpcs:disable directives with clear explanations to each affected file:

  • WordPress.Security.EscapeOutput.ExceptionNotEscaped — Exceptions are not WordPress output in this framework-agnostic library
  • WordPress.WP.AlternativeFunctions — Native PHP functions (cURL, json_encode, file_get_contents) required for framework independence
  • WordPress.PHP.DiscouragedPHPFunctions — base64_encode/urlencode required for OAuth and API operations
  • WordPress.PHP.NoSilencedErrors@Unlink used for temporary file cleanup in HttpClient
  • Universal.Operators.DisallowShortTernary — Short ternary intentionally used for concise null/empty handling

Changes

  • 16 source files in src/ — added specific phpcs:disable per file
  • 31 example files in examples/ — added blanket phpcs:disable
  • 22 test files in tests/ — added phpcs:disable for AlternativeFunctions
  • Updated CHANGELOG.md with v1.0.1 entry

Verification

  • 0 PHPCS errors, 0 warnings across all src/, examples/, and tests/
  • All 455 tests pass with 1192 assertions
  • No functional code changes — only inline PHPCS comment directives

…lity

Added phpcs:disable comments to all source, example, and test files
so the library passes WordPress coding standards when bundled as a
vendor dependency inside WordPress plugins.

No functional code changes — only inline PHPCS comment directives.
@alihesari alihesari merged commit 3d5e498 into main Mar 7, 2026
4 checks passed
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.

1 participant