Skip to content

fix: resolve WordPress Plugin Check PHPCS violations#2

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

fix: resolve WordPress Plugin Check PHPCS violations#2
alihesari merged 2 commits intomainfrom
fix/phpcs-wordpress-plugin-check-compatibility

Conversation

@alihesari
Copy link
Member

Summary

Resolves all WordPress Plugin Check PHPCS violations in both the plugin source and the bundled owlstack-core vendor dependency.

Changes

Plugin source (src/)

  • Fixed 9 short ternary (?:) errors across 6 files — replaced with explicit ternary expressions
  • Added phpcs:ignore comments for 3 intentional base64_encode/base64_decode usages in WpTokenStore (used for encrypted token storage)
  • Removed defined('ABSPATH') || exit; guard from helpers.php — it caused Composer autoloader to exit() when running CLI tools like PHPCS

Vendor dependency

  • Updated owlstack/owlstack-core from v1.0.0 to v1.0.1 (see owlstack-core PR #10)
  • v1.0.1 adds phpcs:disable directives to all source files for WordPress Plugin Check compatibility

Dev dependencies

  • Added wp-coding-standards/wpcs and dealerdirect/phpcodesniffer-composer-installer to require-dev

Verification

$ phpcs --standard=WordPress --sniffs=WordPress.Security.EscapeOutput,... src/ vendor/owlstack/
# 0 errors, 0 warnings

Before: 134 errors + 52 warnings in owlstack-core, 9 errors + 3 warnings in plugin source
After: 0 errors, 0 warnings across the entire plugin

- Fix 9 short ternary (?:) errors across 6 source files
- Add phpcs:ignore for 3 intentional base64 usages in WpTokenStore
- Remove ABSPATH guard from helpers.php (breaks CLI autoloader)
- Update owlstack-core to v1.0.1 (includes PHPCS directives)
- Update composer.json dev dependencies (WPCS, PHPCS installer)

All plugin source and vendor/owlstack files now pass WordPress
coding standards with zero errors and zero warnings.
- Fix plugin header: Text Domain: owlstack -> owlstack-wp
- Fix all 98 translation function text domain arguments from 'owlstack' to 'owlstack-wp'
- Keep menu/settings page slugs as 'owlstack' (these are NOT text domains)
- Add AGENTS.md with text domain rules to prevent this mistake from recurring
- Add CLAUDE.md with Claude-specific instructions

The text domain must match the plugin folder name ('owlstack-wp') per WordPress
Plugin Check requirements. The string 'owlstack' (without -wp) is only used as
the admin menu slug and settings page slug.
@alihesari alihesari merged commit 35136cb into main Mar 7, 2026
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