Skip to content

refactor: delete feedback system (v0.11 PR 3c/4) - #195

Merged
pluginslab merged 1 commit into
devfrom
feature/delete-feedback-system
May 12, 2026
Merged

pluginslab merged 1 commit into
devfrom
feature/delete-feedback-system

Conversation

@pluginslab

Copy link
Copy Markdown
Owner

Summary

Deletes the S3-upload feedback system per the v1 Roadmap doc — "Only useful at scale, S3 upload contradicts privacy story."

This is the biggest of the v0.11 strip-down PRs. Net: -1292 / +9 lines, 13 files touched.

What's deleted (5 files)

File Purpose LoC
`src/extensions/services/feedback.js` Service layer — opt-in storage, message ratings, S3 upload 236
`src/extensions/components/FeedbackTab.jsx` The "Feedback" admin tab 205
`src/extensions/components/FeedbackOptInBanner.jsx` Opt-in banner shown after first exchange 67
`scripts/feedback-dev.sh` Dev script for local feedback testing 160
`scripts/export-feedback.sh` Dev script for exporting collected feedback 18

What's edited (8 files)

File Change
`src/extensions/App.jsx` Drop FeedbackTab + FEEDBACK_UPLOAD_ENABLED imports; remove conditional tab entry and render case
`src/extensions/components/ChatContainer.jsx` Drop feedback service imports, feedbackOptIn state, accept/decline/thumbs handlers, banner JSX, props passed to MessageList
`src/extensions/components/MessageList.jsx` Drop feedbackOptIn + onFeedback prop passthrough
`src/extensions/components/MessageItem.jsx` Drop getMessageRating import, rating state, handleRating, entire thumbs-up/down JSX block
`src/extensions/styles/main.scss` Remove 3 blocks: .agentic-feedback-banner (73 lines), .wp-agentic-feedback Feedback Tab (206 lines), .agentic-message__feedback / __thumb (42 lines)
`includes/class-admin-page.php` Drop feedback_optin localized var + settingsUrl entry
`includes/class-settings.php` Drop register_rest_routes() + update_settings_rest() — only purpose was the feedback_optin endpoint; also drop the rest_api_init hook
`webpack.config.js` Drop FEEDBACK_S3_ENDPOINT DefinePlugin entry + now-unused 'webpack' require

Recovery path

Every deleted file is in git history. If reintroducing as a v1.x Labs feature, lift from a pre-merge commit and consider a privacy-respecting backend (self-hosted endpoint instead of shared S3).

```bash
git show :src/extensions/services/feedback.js > src/extensions/services/feedback.js
```

Verification

  • `npm test` — 117 passing (test count unchanged; feedback had no unit tests)
  • `npm run build` — succeeds, no orphan import errors
  • `composer lint` — clean (the $default warning is pre-existing)
  • `npx wp-scripts lint-js` — clean on all 5 changed JS files (2 pre-existing warnings in ChatContainer are not introduced here)
  • Reference scan: `grep -r` for FeedbackTab / FeedbackOptInBanner / FEEDBACK_UPLOAD_ENABLED / saveFeedback / getFeedbackOptIn / getMessageRating returns zero hits in src/ or includes/

Roadmap context

PR Status
#191 Manifest pattern ✅ merged
#192 Voice out of default build ✅ merged
#193 Delete 4 simple abilities (open, CI green)
#194 Delete webmcp-bridge (open, CI green)
This PR Delete feedback system
TBD PR 4: flip manifest default to core+local-only

Test plan

  • Build check passes
  • PHP lint passes
  • JS lint passes
  • Unit tests pass (117)
  • Manual: load plugin in playground; tabs show Chat / Abilities / Plugin Abilities only (no Feedback). Send a message and confirm the reply renders without thumbs and the opt-in banner never appears.

🤖 Generated with Claude Code

Removes the S3-upload feedback system that contradicted the plugin's
privacy-first story (per the v1 Roadmap doc: "Only useful at scale,
S3 upload contradicts privacy story.").

Deleted (5 files, ~686 lines):
  - src/extensions/services/feedback.js
  - src/extensions/components/FeedbackTab.jsx
  - src/extensions/components/FeedbackOptInBanner.jsx
  - scripts/feedback-dev.sh
  - scripts/export-feedback.sh

Stripped from existing files (~600 lines removed):

  src/extensions/App.jsx
    - FeedbackTab + FEEDBACK_UPLOAD_ENABLED imports
    - Conditional Feedback tab entry + render case

  src/extensions/components/ChatContainer.jsx
    - feedback service imports
    - feedbackOptIn state + handlers (accept, decline, thumbs)
    - FeedbackOptInBanner JSX
    - feedbackOptIn / onFeedback props passed to MessageList

  src/extensions/components/MessageList.jsx
    - feedbackOptIn + onFeedback prop passthrough

  src/extensions/components/MessageItem.jsx
    - getMessageRating import + rating state
    - handleRating handler
    - Entire thumbs-up/down JSX (~55 lines)

  src/extensions/styles/main.scss
    - .agentic-feedback-banner block (~73 lines)
    - .wp-agentic-feedback (Feedback Tab) block (~206 lines)
    - .agentic-message__feedback + .agentic-message__thumb (~42 lines)

  includes/class-admin-page.php
    - feedback_optin localized var + settingsUrl entry

  includes/class-settings.php
    - register_rest_routes() + update_settings_rest() — only purpose
      was the feedback_optin endpoint
    - rest_api_init hook registration

  webpack.config.js
    - FEEDBACK_S3_ENDPOINT DefinePlugin entry
    - Now-unused 'webpack' require

Net: -606 / +9, 13 files touched.

Recovery: every deleted file is in git history. Lift from a pre-PR-3c
commit if reintroducing as a v1.x Labs feature with a privacy-respecting
backend (e.g., self-hosted endpoint instead of shared S3).

Tests: 117 passing (test count unchanged — feedback had no unit tests).
Build: clean.
Lint: clean. Two pre-existing ChatContainer warnings remain, not
introduced here. PHP $default warning is pre-existing.
Reference scan: zero remaining FeedbackTab / FeedbackOptInBanner /
FEEDBACK_UPLOAD_ENABLED / saveFeedback / getFeedbackOptIn /
getMessageRating hits in src/ or includes/.

Roadmap context:
  - PR #191: manifest pattern ✅
  - PR #192: voice out of default build ✅
  - PR #193: delete 4 simple abilities (open, CI green)
  - PR #194: delete webmcp-bridge (open, CI green)
  - PR 3c (this): delete feedback system
  - PR 4 (next): flip manifest default to core+local-only

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@pluginslab
pluginslab merged commit 826558a into dev May 12, 2026
4 checks passed
@pluginslab
pluginslab deleted the feature/delete-feedback-system branch May 12, 2026 08:07
pluginslab added a commit that referenced this pull request May 12, 2026
Last piece of the v0.11 strip-down. Labs (parked) abilities now require
opt-in to be registered, completing the WordPress.org submission path.

PHP — includes/abilities-manifest.php:
  resolve_enabled_abilities() now gates the labs array on the
  WP_AGENTIC_ADMIN_ENABLE_LABS constant. The wp_agentic_admin_enabled_abilities
  filter remains the per-ability override path:

    define( 'WP_AGENTIC_ADMIN_ENABLE_LABS', true );        // all labs
    add_filter( 'wp_agentic_admin_enabled_abilities', ... ); // selective

  New helper: wp_agentic_admin_labs_enabled() — single source of truth
  for the boolean.

PHP — includes/class-admin-page.php:
  Localizes two new fields on window.wpAgenticAdmin:
    - enabledAbilities: PHP-resolved slug list (the result of the
      filter above)
    - enableLabs: bool, mirrors wp_agentic_admin_labs_enabled()

  PHP becomes authoritative for which PHP-backed abilities the JS
  manifest registers.

JS — src/extensions/abilities/manifest.js:
  New JS_ONLY_ABILITIES set captures the slugs that have no PHP
  register function (current-user-role, core-site-info, core-environment-info,
  codebase-index, code-search, wp-config-list, content-generate).
  PHP's enabledAbilities list can't include these, so JS adds them
  back. Members that are also LABS are gated by enableLabs.

JS — src/extensions/abilities/index.js:
  registerAllAbilities() now delegates slug resolution to a new
  exported resolveEnabledSlugs() function:
    - With PHP-localized enabledAbilities: register that list ∪
      (JS_ONLY_ABILITIES minus labs-when-off)
    - Without (tests / dev): register all REGISTRARS minus LABS
      unless enableLabs is set

  Falls back gracefully when window.wpAgenticAdmin is unset, so
  Jest tests don't have to mock the global.

Tests:
  - manifest.test.js: 2 new cases covering JS_ONLY_ABILITIES contract
  - index.test.js (new file, 6 cases): PHP-authoritative path with
    labs on/off, empty PHP list edge case, fallback path with and
    without enableLabs

PHP smoke verification (manual):
  Without constant: 33 abilities resolved (CORE + LOCAL_ONLY)
  With constant:    39 abilities resolved (+6 labs)

Tests: 124 passing (was 117, +7 new).
Build: clean.
Lint: clean (PHP + JS + Prettier).

Roadmap context — END OF v0.11 STRIP-DOWN:
  - PR #191: manifest pattern ✅ merged
  - PR #192: voice out of default build ✅ merged
  - PR #193: delete 4 simple abilities (open)
  - PR #194: delete webmcp-bridge (open)
  - PR #195: delete feedback system (open)
  - PR 4 (this): flip default to core+local-only

After all six merge: ~3,800 LoC removed, 819 KB shipped bundle
dropped, 35 PHP abilities registered by default (down from 39),
plugin ready for WP.org submission (modulo the remaining 6 security
+ 6 compliance issues from the roadmap).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ivdimova pushed a commit that referenced this pull request May 12, 2026
…prefix uninstall globals (#198)

Bundles four small Plugin Checker fixes ahead of the WordPress.org
submission path.

Resolves #133:
  - Remove CLOUDFEST_HACKATHON.md from .distpackage so it doesn't ship.
    File stays in the repo for archival reference.
  - Also delete docs/FEEDBACK-DEV.md (stale documentation for the
    feedback system removed in PR #195).

Resolves #132:
  - Drop the "Domain Path: /languages" header from wp-agentic-admin.php.
    The languages/ directory doesn't exist in the repo, and the header
    isn't needed for WP.org-hosted plugins (translations are auto-loaded
    from translate.wordpress.org).

Resolves #131:
  - Remove the load_plugin_textdomain() call. WordPress 4.6+ loads
    translations automatically for plugins hosted on WordPress.org, so
    the call is flagged by the Plugin Checker as a discouraged function.
    Replaced the now-empty private method + its caller with a brief
    explanatory comment.

Resolves #130:
  - Prefix $sites and $site in the multisite cleanup branch of
    uninstall.php to $wp_agentic_admin_sites / $wp_agentic_admin_site.
    Satisfies WordPress.NamingConventions.PrefixAllGlobals.

Tests: 96 passing, 0 changed (mechanical fixes only).
PHP lint: clean.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.

1 participant