Repository navigation
GH#90: support dynamically inserted comments - #118
Conversation
|
Warning Review limit reachedYou'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 59 minutes. View limit details
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. Comment |
Implementation checkpoint — runtime blockedIssue #90 is preserved in this draft at Scoped PHP syntax, PHPCS, ESLint, PHPStan, webpack build, and whitespace checks passed with only evidenced pre-existing warnings. Independent source review found no material defects, but does not establish runtime acceptance. Blocker: the configured runner cannot access an authorized disposable WordPress test database/site. Existing ownership/AJAX tests and actual two-browser WP Ajaxify/Lazy Load flows therefore remain unverified. This draft is not a successful post-PR handoff and must not merge or close #90 yet. The PR body preserves the acceptance matrix, exact commands, and recovery steps; BuddyBoss remains explicitly unverified. Recovery owner: runner administrator. Provide the isolated site's/database's authorized configuration through the existing runner/secret mechanism, then resume this PR and run the required product paths before readiness and the guarded merge attempt. No credentials belong in GitHub comments. Pending remote checks were observed once and were not polled. No release/deployment is authorized. aidevops.sh v3.39.27 plugin for OpenCode v1.19.0 with gpt-6.1-sol spent 18m and 202,529 tokens on this as a headless worker. |
Summary
Resolves #90.
window.SCE.init(root)and DOM-insertion initialization while retaining the single-button and WP Ajaxify APIs. Detached/replaced controls release timers/editors and stale time responses are ignored.sce_ajax_comment_submissionfilter around an integration's existing validated creation call. Guest ownership is established during creation; no arbitrary-comment claim endpoint is added.AGENTS.md. BuddyBoss remains explicitly unverified.Review changes
src/js/comment-editing/editing.js,simple-comment-editing.php,includes/Functions.php, and the existing mutation checks inincludes/Ajax.php. Follow-up review correctedcan_edit()to resolve a local$commentwithout overwriting the WordPress loop global; filter arguments still receive the requested comment, and the global-write PHPCS suppression is removed.tests/Functions_Test.php, using the existing real WordPress test framework: stale logged-in-owner comment global, empty ownership values, trashed comment, missing comment, preservation of an existing loop global on success/denial/early return, and keeping an unset global absent.README.mdandreadme.txtwith verified compatibility and the Twenty Twenty-Five Ajaxify selector requirement. The default selector matches both the comments wrapper and heading, causing a full-page fallback; configure.wp-block-commentsinstead.Verification
Passed locally:
composer test: 59 tests, 251 assertions, single-site, rerun after merging the latest base branch.WP_MULTISITE=1 composer test: 59 tests, 251 assertions, multisite, rerun after merging the latest base branch; run sequentially against the disposable test database, never the browser site's database.composer lint: PHPCS zero errors; PHPStan no errors. Existing PHP warnings remain.php -l includes/Functions.php, scoped PHPCS, andcomposer phpstan -- includes/Functions.phppass; the existing capability-spelling PHPCS warning remains.vendor/bin/phpcs tests/Functions_Test.php: zero errors/warnings.npm run lint:js: zero errors. After merging the latest base,npx --no-install eslint src/js/comment-editing/editing.jsreports zero errors and seven existing warnings.npm ci --ignore-scriptsandnpm run build: successful after merging the latest base. The conflicting editor bundle was regenerated from the combined source and latest lockfile, preserving upstream WooCommerce fixes and the dependency update. Admin/CSS outputs match the base branch exactly. Three existing admin-bundle size warnings remain.node --check dist/sce-editing.jsandgit diff --cached --check: passed before the merge commit.git diff --check.wp_handle_comment_submission()with the AJAX opt-in issued ownership, allowed the owner to edit, preserved the key on a repeated SCE creation callback, and denied editing after clearing cookies. This is PHP-path verification, not a custom HTTP/browser adapter claim.Real browser acceptance (before the latest base-branch sync)
Tested with agent-browser driving Chromium 147 against WordPress 7.1.3 multisite, PHP 8.4.25, and Twenty Twenty-Five 1.4. The plugin was activated from the PR worktree through a plugins-directory symlink. Separate guest-owner, subscriber, and non-owner browser sessions were used.
can_edit:false; save/delete using the owner's valid guest nonce were rejected and content remained unchanged. Invalid-nonce requests were also rejected.Boundaries
admin-ajax.phpsubmission adapter were not browser-tested. The verified Ajaxify flow uses its normal WordPress submission route.WP_DEBUGoff); no claim of WordPress debug-log verification is made.aidevops.sh v3.39.36 plugin for OpenCode