Skip to content

fix: resolve WordPress Plugin Check errors and warnings - #48

Merged
jackgranatowski merged 1 commit into
mainfrom
claude/affectionate-shannon-nh8sjw
Jun 19, 2026
Merged

fix: resolve WordPress Plugin Check errors and warnings#48
jackgranatowski merged 1 commit into
mainfrom
claude/affectionate-shannon-nh8sjw

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all errors and warnings reported by the WordPress Plugin Check tool.

  • Fix text domain mismatch in class-classes.php — strings used slashed-bricks but the unified plugin declares slashed as its text domain
  • Remove load_plugin_textdomain() calls from slashed.php, slashed-bricks.php, and slashed-gutenberg.php — deprecated since WP 4.6; WordPress.org auto-loads translations for hosted plugins
  • Suppress false-positive sanitization warning in class-manual-css-page.phpwp_kses() corrupts valid CSS selectors (e.g. >, [attr~="val"]); the value is validated against injection patterns and escaped at render time
  • Suppress direct DB query warnings in class-rebemer-rest.php — already uses $wpdb->prepare(); caching is incorrect here because the reBEMer scan result varies per call
  • Suppress dynamic hook name warnings in class-inventory.php — hook names are correctly prefixed via filter_slug() which returns the integration-specific prefix (e.g. slashed_bricks)

Remaining non-issue

The no_plugin_readme error is a false positive — readme.txt exists at the plugin root; Plugin Check ran from a subdirectory path.

Test plan

  • Run WordPress Plugin Check against the plugin — no ERRORs, warnings suppressed with explanatory comments
  • Confirm translations still load (WP auto-loads from languages/ for WP.org-hosted plugins)
  • Confirm Bricks category names render correctly in editor

Generated by Claude Code


Summary by cubic

Resolves all WordPress Plugin Check errors and warnings by fixing text domains, removing deprecated translation loaders, and silencing tool false positives without changing runtime behavior.

  • Bug Fixes
    • Bricks category text domain corrected from slashed-bricks to slashed.
    • Removed deprecated load_plugin_textdomain() from slashed.php, integrations/bricks/slashed-bricks.php, and integrations/gutenberg/slashed-gutenberg.php (WP auto-loads translations for WP.org plugins).
    • Manual CSS: added phpcs:ignore to avoid corrupting valid CSS; value is validated and escaped on output.
    • reBEMer REST: added phpcs:ignore for direct DB query and no caching; queries are prepared and vary per call.
    • Inventory: added phpcs:ignore for dynamic hook names; names are safely prefixed via filter_slug().

Written for commit 49481cd. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Consolidated plugin translation text domains to use a unified localization system across integration modules.
    • Added code quality annotations to improve maintainability throughout the codebase.

- Fix text domain mismatch in class-classes.php (slashed-bricks → slashed)
- Remove deprecated load_plugin_textdomain() calls (auto-loaded since WP 4.6)
- Add phpcs:ignore for manual CSS sanitization (wp_kses corrupts valid CSS selectors)
- Add phpcs:ignore for direct DB query in reBEMer REST (caching incorrect for scan)
- Add phpcs:ignore for dynamic hook names in class-inventory.php (prefixed via filter_slug())
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a175f61a-d341-4217-aca2-8690521409ad

📥 Commits

Reviewing files that changed from the base of the PR and between 966822f and 49481cd.

📒 Files selected for processing (7)
  • SLASHED-for-WP/includes/class-inventory.php
  • SLASHED-for-WP/includes/class-manual-css-page.php
  • SLASHED-for-WP/integrations/bricks/includes/class-classes.php
  • SLASHED-for-WP/integrations/bricks/includes/class-rebemer-rest.php
  • SLASHED-for-WP/integrations/bricks/slashed-bricks.php
  • SLASHED-for-WP/integrations/gutenberg/slashed-gutenberg.php
  • SLASHED-for-WP/slashed.php
💤 Files with no reviewable changes (3)
  • SLASHED-for-WP/integrations/gutenberg/slashed-gutenberg.php
  • SLASHED-for-WP/integrations/bricks/slashed-bricks.php
  • SLASHED-for-WP/slashed.php

📝 Walkthrough

Walkthrough

Three standalone-mode add_action('init', load_plugin_textdomain(...)) blocks are removed from the main plugin and two integration entry points. One translation text domain string in the Bricks class categories builder is corrected from slashed-bricks to slashed. Four PHPCS suppression comments are added to silence coding-standard warnings without altering logic.

Changes

PHPCS Suppressions and Text Domain Cleanup

Layer / File(s) Summary
Remove standalone-mode text domain init hooks and fix domain string
SLASHED-for-WP/slashed.php, SLASHED-for-WP/integrations/bricks/slashed-bricks.php, SLASHED-for-WP/integrations/gutenberg/slashed-gutenberg.php, SLASHED-for-WP/integrations/bricks/includes/class-classes.php
Deletes the conditional add_action('init', load_plugin_textdomain(...)) blocks from three plugin entry points that previously ran only when the respective *_VERSION constant was undefined. Also changes the i18n domain for SLASHED Layout and SLASHED State category names in build_categories() from slashed-bricks to slashed.
Add PHPCS ignore comments
SLASHED-for-WP/includes/class-inventory.php, SLASHED-for-WP/includes/class-manual-css-page.php, SLASHED-for-WP/integrations/bricks/includes/class-rebemer-rest.php
Appends inline phpcs:ignore comments to two apply_filters() expressions in Slashed_Inventory, adds a comment in handle_save() explaining why raw CSS is stored without wp_kses sanitization, and inserts a suppression for the direct DB query in count_class_references().

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Possibly related PRs

  • codeslash-dev/SLASHED-Plugins#19: Directly related — that PR also adds or repositions a phpcs:ignore comment for the direct database query inside count_class_references() in class-rebemer-rest.php.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: resolve WordPress Plugin Check errors and warnings' directly and accurately reflects the main objective of the changeset, which is to address issues identified by the WordPress Plugin Check tool across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/affectionate-shannon-nh8sjw

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Re-trigger cubic

@jackgranatowski
jackgranatowski merged commit 386e4ce into main Jun 19, 2026
10 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.

2 participants