Skip to content

Conversation

@GaryJones
Copy link
Contributor

Summary

Comprehensive PHPCS coding standards fixes across the syndication plugin codebase. This PR addresses multiple categories of violations to improve code quality and maintainability.

Changes included:

  • Automatic fixes - Applied phpcbf for auto-fixable issues (spacing, alignment)
  • Comment punctuation - Ensured inline comments end with proper punctuation
  • Function docblocks - Added missing @param and @return documentation
  • Yoda conditions - Applied WordPress-style comparisons ('value' === $var)
  • Method visibility - Added explicit public/private keywords to all methods
  • Docblock formatting - Capitalised short descriptions, added full stops to param comments
  • File/class docblocks - Added @package Syndication headers and class descriptions
  • Empty statement handling - Added phpcs:ignore for intentional placeholder blocks

Not addressed (deferred to 3.0.0):

  • Variable naming conventions (breaking change risk)
  • Hook naming prefixes (breaking change risk)
  • Security validations (requires careful analysis)
  • Remaining FileComment.Missing for files with require_once (will be resolved with namespace refactor)

Test plan

  • Run composer cs to verify no regressions
  • Verify plugin activates without errors
  • Test basic syndication functionality

🤖 Generated with Claude Code

GaryJones and others added 10 commits January 8, 2026 14:25
Apply PHPCBF (PHP Code Beautifier and Fixer) to automatically resolve
1694 coding standards violations across 17 files. The remaining ~1000
violations require manual attention.

Fixes include spacing, array formatting, comment formatting, brace
positioning, and modernising dirname(__FILE__) to __DIR__.

All unit tests pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WordPress coding standards require all inline comments to end with
full stops, exclamation marks, or question marks. This change updates
inline comments across the codebase to comply with the
Squiz.Commenting.InlineComment.InvalidEndChar PHPCS rule, improving
code consistency and maintainability.
Add missing function docblocks to satisfy the
Squiz.Commenting.FunctionComment.Missing PHPCS rule. This is the first
batch addressing 55 of 133 missing docblocks across 6 files:

- class-syndication-admin-notices.php (3 docblocks)
- class-syndication-logger.php (1 docblock)
- class-wp-cli.php (7 docblocks)
- class-syndication-logger-viewer.php (17 docblocks)
- class-syndication-wp-rest-client.php (11 docblocks)
- class-syndication-wp-rss-client.php (16 docblocks)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add missing function docblocks to the Syndication_Client_Factory class
to satisfy the Squiz.Commenting.FunctionComment.Missing PHPCS rule.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Converts 19 standard comparisons to Yoda condition format across four files to comply with WordPress PHP Coding Standards. Yoda conditions place the constant or literal value on the left side of the comparison, which prevents accidental variable assignment when a single equals sign is mistakenly used instead of a comparison operator.
Replaced @inheritdoc tags with complete docblocks in encryption classes
and corrected malformed @param tags throughout the codebase. The changes
ensure each parameter has proper type hints and descriptions, resolving
106 PHPCS violations related to missing or improperly formatted parameter
documentation.

This improves IDE support and makes the codebase more maintainable by
providing clear documentation for method signatures across encryption,
event handling, syndication, and CLI components.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolves multiple PHPCS violations related to documentation formatting. Adds missing full stops to parameter descriptions, capitalises the first letter of docblock descriptions where required, and removes extraneous blank lines after class docblocks to align with WordPress coding standards.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolves remaining PHPCS violations across core syndication classes by adding missing method visibility keywords and converting single-line comments to proper docblock format. Ensures all public API methods and overridden methods are explicitly marked, whilst helper methods receive appropriate private visibility. Also removes extraneous blank lines before closing braces in HTML output contexts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds phpcs:ignore comments for empty if/elseif blocks that are intentional placeholders for future functionality (TODOs for extra data sanitization, term object type support, and attachment update failure handling). Also fixes a Yoda condition and corrects a typo in a comment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds comprehensive file-level and class-level documentation across the plugin to satisfy WordPress coding standards requirements. Every PHP file now includes a @Package tag in its file header, and all classes have descriptive docblocks explaining their purpose and responsibility within the syndication system.

Also updates .distignore and .gitattributes to exclude the .claude/ directory from distribution packages and exports.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@GaryJones GaryJones requested a review from a team as a code owner January 11, 2026 14:15
@GaryJones GaryJones added the type: maintenance Routine maintenance and code quality improvements label Jan 11, 2026
@GaryJones GaryJones self-assigned this Jan 11, 2026
@GaryJones GaryJones added this to the 3.0.0 milestone Jan 11, 2026
@GaryJones GaryJones merged commit e75fe7f into develop Jan 11, 2026
8 checks passed
@GaryJones GaryJones deleted the chore/phpcs-fixes branch January 11, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: maintenance Routine maintenance and code quality improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants