Skip to content

fix: include readme.txt and license.txt in zip, fix phpcs:disable scope - #49

Merged
jackgranatowski merged 3 commits into
mainfrom
claude/affectionate-shannon-nh8sjw
Jun 19, 2026
Merged

fix: include readme.txt and license.txt in zip, fix phpcs:disable scope#49
jackgranatowski merged 3 commits into
mainfrom
claude/affectionate-shannon-nh8sjw

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Two fixes from the second Plugin Check run:

  • readme.txt missing from zipscripts/zip-plugin.js only packed PHP files and asset directories; readme.txt and license.txt were not in the INCLUDE list. Both are now included so the distributed zip is complete for WordPress.org.
  • Sanitization warning still firing on line 66 — the previous phpcs:ignore only suppressed line 65 (isset(...)), but the $_POST access also appears on line 66 (the ternary branch). Switched to phpcs:disable / phpcs:enable to wrap the full two-line block.

Test plan

  • Run npm run build:zip and confirm readme.txt and license.txt are present inside dist/slashed.zip under slashed/
  • Run WordPress Plugin Check — no remaining errors or warnings

Generated by Claude Code


Summary by cubic

Include readme.txt and license.txt in the plugin zip, mark them as required, and fix the PHPCS suppression scope to cover the full input read. This makes the zip WordPress.org-compliant and removes the lingering sanitization warning.

  • Bug Fixes
    • Added readme.txt and license.txt to the INCLUDE list in scripts/zip-plugin.js and marked them required: true so they’re packaged in slashed/ and the build fails if missing.
    • Switched from single-line phpcs:ignore to scoped phpcs:disable/phpcs:enable in class-manual-css-page.php to cover both ternary lines that access $_POST.

Written for commit 2286a2e. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Refactor

    • Improved internal code documentation handling for better maintainability.
  • Documentation

    • Plugin distribution package now includes readme.txt and license.txt files for better user guidance.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Two minor changes: the PHPCS suppression comment around wp_unslash($_POST['slashed_manual_css']) in handle_save() is widened from a single-line ignore to a disable/enable block; and readme.txt and license.txt are added to the zip-packaging script's include list.

Changes

Annotation fix and packaging additions

Layer / File(s) Summary
PHPCS disable/enable block around raw POST input
SLASHED-for-WP/includes/class-manual-css-page.php
Replaces the single-line phpcs:ignore with a scoped phpcs:disable/phpcs:enable block surrounding the wp_unslash($_POST['slashed_manual_css']) assignment; no functional logic changes.
Include readme.txt and license.txt in plugin zip
scripts/zip-plugin.js
Adds readme.txt and license.txt to the INCLUDE array so both files are copied into the slashed/ directory and bundled in dist/slashed.zip.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • codeslash-dev/SLASHED-Plugins#30: Implements Slashed_Manual_CSS_Page::handle_save() in the same file where this PR changes the PHPCS annotation around raw slashed_manual_css input handling.
  • codeslash-dev/SLASHED-Plugins#47: Introduces SLASHED-for-WP/readme.txt and SLASHED-for-WP/license.txt, which are the exact files this PR adds to the zip packaging script's include list.
  • codeslash-dev/SLASHED-Plugins#48: Also modifies Slashed_Manual_CSS_Page::handle_save() by changing PHPCS suppression annotations around the same raw slashed_manual_css handling.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes both main changes: including readme.txt and license.txt in the zip file, and fixing the phpcs:disable scope to properly suppress warnings across both affected lines.
Docstring Coverage ✅ Passed Docstring coverage is 100.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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/zip-plugin.js`:
- Around line 42-43: The readme.txt and license.txt file entries in the
packaging configuration do not have the required flag set, causing missing files
to only warn instead of failing the build. Add required: true property to both
the entry with src pointing to readme.txt and the entry with src pointing to
license.txt to ensure the zip packaging fails fast during CI/release if these
critical files are missing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7486cb46-e2f2-47f3-9b8e-c8e1dfb4861b

📥 Commits

Reviewing files that changed from the base of the PR and between a4846c2 and a43b33f.

📒 Files selected for processing (2)
  • SLASHED-for-WP/includes/class-manual-css-page.php
  • scripts/zip-plugin.js

Comment thread scripts/zip-plugin.js Outdated
@jackgranatowski
jackgranatowski merged commit c9bba96 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