Skip to content

GH#93: recover guarded moderator comment movement - #127

Merged
superdav42 merged 5 commits into
masterfrom
feature/gh93-comment-movement-recovery
Oct 20, 2026
Merged

superdav42 merged 5 commits into
masterfrom
feature/gh93-comment-movement-recovery

Conversation

@superdav42

@superdav42 superdav42 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Resolves #93. Replaces closed/conflicted PR #119 by recovering all four implementation commits onto current master and preserving the newer dynamic-comment and WP ULike documentation.

  • Native Comments row action and Move comment page, read-only preview, and explicit nonce/HMAC-bound single-comment or subtree confirmation.
  • Moderation, per-comment edit and both-post read/edit checks; invalid destination/review/thread rejection. Every descendant status/type is included so spam/trash and hidden note replies cannot evade validation.
  • Valid child reparenting/subtree threading, guarded InnoDB placement/count transactions, and private non-autoloaded placement-only recovery journals. No public/AJAX mutation endpoint or new runner/test-only interface.

Files and reference pattern

  • includes/Admin/Admin_Settings.php initializes Comment_Movement via the existing admin path.
  • includes/Admin/Comment_Movement.php owns row action, preview/confirmation, transactions and recovery.
  • readme.txt and DESIGN.md document workflow, exclusions, additive private options and native-admin accessibility/responsiveness.
  • simple-comment-editing.php already initializes Admin_Settings and is intentionally unchanged.

Runtime Testing — verified

Exact head: d47c96c. Existing WordPress 7.1.3 site, isolated fixture Editor/Subscriber/guest browser sessions, and dedicated posts/comments. No credentials are included in evidence.

Acceptance criterion Result and evidence
Authorized moderator can move one comment or its subtree with valid parents/counts Passed native Comments-row entry point, preview and Confirm. Single move: counts 4/1 → 3/2; moved root top-level, direct children under the old parent, deeper parents unchanged. Subtree: 4/1 → 1/4, internal parents preserved, including a pending grandchild.
Single mode leaves valid source threading and confirms child behavior first Passed preview text/counts, Cancel without mutation, single-mode parent assertions and Restore back to 4/1.
Unauthorized/invalid requests cannot move; partial failure is recoverable Guest POST 400, Subscriber POST 403, invalid move/recovery nonce 403; invalid destination 400; stale preview 409; duplicate confirmation 400. Spam/trash/post-trashed/note descendants and cyclic threads rejected. Recovery refused new spam/note replies without placement changes. A fixture-only simulated interrupted mixed-placement state blocked new moves and restored all original parents/counts through the actual recovery UI.

Content, metadata, author and approval preservation were checked with WP-CLI. The interrupted-state test was a controlled fixture simulation, not an induced database outage. Desktop 1280×900 and mobile 390×844 captures had scroll widths 1280/390, no horizontal overflow; Tab, radio arrow keys and Enter worked. No uncaught browser errors; successful admin navigation was HTTP 200. Existing debug.log had no feature entries and was unchanged since before this run; WP_DEBUG_LOG is disabled, so no fresh PHP debug-log coverage is claimed. Created posts/comments/users and fixture-only journals were removed, activation state restored, and the prior shared plugin link was left untouched.

Static verification and review

  • Passed php -l for includes/Admin/Comment_Movement.php, includes/Admin/Admin_Settings.php and simple-comment-editing.php; git diff --check passed.
  • Local vendor PHPCS/PHPStan/PHPUnit are absent, global PHPCS lacks WordPress/PHPCompatibility standards, and .aidevops.json/.verify/worktree-local .venv tooling are absent. CI equivalents: Code Quality / PHPCS and PHPStan, and the existing PHPUnit matrix. npm run build reports webpack unavailable; Code Quality / ESLint and build covers it. No JS/SCSS or generated asset changes are part of this PR; the verified native admin surface uses core assets. Missing CI-covered local tools are not a handoff blocker.
  • Independent read-only safety review found no further blocking defect. Exact-head branch review bundle is prompt-injection clean; bundle digest: 01855c6a9bbb00fc949d508d12011bb4272202ceda35156c30eeef7bc1d96e89.
  • Live coverage is WordPress 7.1.3 single-site; the existing CI matrix covers supported PHP/WordPress combinations and multisite. No release or live-site deployment is included.

aidevops.sh v3.39.49 plugin for OpenCode v1.19.0 with gpt-6.1-sol spent 27m and 558,006 tokens on this as a headless worker.

@superdav42 superdav42 added the origin:worker Created by headless/pulse worker session label Oct 20, 2026
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: Ultimate-Multisite/simple-comment-editing/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 239c49cd-d11a-46c7-a8e9-4bd6f874afab
📥 Commits

Reviewing files that changed from the base of the PR and between fbcc780 and d47c96c.

📒 Files selected for processing: 4
  • DESIGN.md
  • includes/Admin/Admin_Settings.php
  • includes/Admin/Comment_Movement.php
  • readme.txt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@superdav42

superdav42 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Completion Summary

  • What: recovered moderator-only comment/subtree movement from closed PR GH#93: add moderator comment movement with preview and recovery #119 onto current master and fixed hidden-descendant validation.
  • Issue: Allow moderators to move a comment to another post with optional child comments #93
  • Files: includes/Admin/Admin_Settings.php, includes/Admin/Comment_Movement.php, readme.txt, DESIGN.md.
  • Exact head: d47c96c.
  • Testing: PHP syntax and git diff --check pass. Real WordPress 7.1.3 admin/browser and WP-CLI checks passed for both modes, preview/Cancel, correct parents/counts, unchanged content/metadata/approval, permission/nonce/destination rejection, stale/duplicate requests, hidden descendants/cycles and recovery. Fixture-only simulated interrupted mixed placement blocked new moves and restored original state; no DB outage was induced. Keyboard and 1280×900/390×844 captures passed. Created fixtures removed and activation restored without changing the prior link.
  • Static tools: local PHPCS/PHPStan/PHPUnit and webpack unavailable; named existing Code Quality/PHPUnit CI jobs provide equivalent checks. No JS/SCSS changes or new test infrastructure.
  • Review: independent safety review found no further blocking issue; exact-head bundle digest 01855c6a9bbb00fc949d508d12011bb4272202ceda35156c30eeef7bc1d96e89.
  • Decisions: native admin only; explicit preview/confirmation; placement/count transaction plus private recovery journal; no public mutation endpoint or release.

aidevops.sh v3.39.49 plugin for OpenCode v1.19.0 with gpt-6.1-sol spent 27m and 558,006 tokens on this as a headless worker.

@superdav42
superdav42 marked this pull request as ready for review October 20, 2026 05:42
@superdav42
superdav42 merged commit 332f71e into master Oct 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin:worker Created by headless/pulse worker session

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow moderators to move a comment to another post with optional child comments

1 participant