Skip to content

Commit 4c68250

Browse files
rpgmemclaude
andauthored
Remove docs/ — dev-only design/planning artifacts (#502)
The docs/ folder held six development-only artifacts (a frontend audit, two HTML permission mockups, and the GAP A/B/C planning docs) — none of it runtime code. It is already excluded from the distributed plugin zip via .distignore and is referenced by no PHP/JS, no CI gate, and no build step. The durable design decisions live in CLAUDE.md and CHANGELOG; the long-form working docs are preserved in git history. Also drops the now-dead 'See docs/plans/gap-c-readonly-admin.md' link from the GAP C CHANGELOG entry. (The older historical entry referencing docs/HOOKS-*.md is left as-is — those files were removed long ago and it is part of the shipped record.) The develop deploy rsync uses --delete, so this also clears docs/ from the testes server on the next deploy. https://claude.ai/code/session_015oyFHBoKYyRez9F3ARZjvD Co-authored-by: Claude <noreply@anthropic.com>
1 parent 13cd1ac commit 4c68250

7 files changed

Lines changed: 1 addition & 1525 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The format follows [Keep a Changelog] (https://keepachangelog.com/en/1.1.0/).
4040
- **Audiences** (`ffc_view_audiences`): the unified "Scheduling" menu and its audience sub-pages (dashboard, calendars, environments, audiences, bookings, settings) open read-only; the write handlers (`handle_actions`) and AJAX endpoints keep their existing caps.
4141
- **Recruitment** (`ffc_view_recruitment`): the recruitment admin UI (notices/adjutancies/reasons/candidates tabs) opens read-only — realizing the auditor/operator roles that were previously REST-only. The edit screens require `ffc_manage_recruitment`, and **`RecruitmentAdminActions::dispatch` was hardened** to re-check the manage cap on every destructive action (it previously relied solely on the page-level gate), so opening the page to viewers cannot expose deletes via a crafted URL.
4242

43-
See `docs/plans/gap-c-readonly-admin.md`. Note: the "Scheduling" parent menu now requires `ffc_view_audiences`, so an appointments-only viewer also needs that cap to see the menu (the `ffc_operator` role carries both).
43+
Note: the "Scheduling" parent menu now requires `ffc_view_audiences`, so an appointments-only viewer also needs that cap to see the menu (the `ffc_operator` role carries both).
4444
- **`ffc_operator` is now a complete cross-module read-only auditor (GAP D).** The role already covered certificates, appointments, audiences, reregistration, the activity log, recruitment and short URLs read-only; it now also carries `ffc_view_custom_fields`, `ffc_view_recruitment_settings` and `ffc_view_recruitment_reasons`, so an operator can audit every module surface without write access. It deliberately does **not** grant `ffc_view_settings` (the plugin Settings page exposes SMTP/security config), `ffc_view_recruitment_pii` (raw candidate PII stays a deliberate grant), `ffc_view_forms_api` (external REST integrators) or `ffc_view_as_user` (impersonation). Existing `ffc_operator` roles self-heal on upgrade via `register_module_roles()`. Most of GAP D was already resolved by the taxonomy work (the role's view caps + the `self_scheduling`→`appointments` semantics fix); this completes it.
4545
- **Internal frontend audit — inline admin JS moves to dedicated, lint-tested asset files (no behavior change).** Inline `<script>` blocks embedded in admin PHP are being extracted, file-by-file, into `assets/js/ffc-*.js` so they pass ESLint, get Vitest coverage, and ride the same minify/cache-bust pipeline as every other script. Extracted so far: (1) the v6.3.2 device-threshold upgrade notice's dismiss handler → `ffc-device-threshold-notice.js` (reads its AJAX action + nonce from the notice's `data-*` attributes and the global `ajaxurl`, so the extraction is verbatim with zero server-side interpolation); (2) the forms list-table shortcode copy-to-clipboard handler → `ffc-form-list-copy-shortcode.js` (also removed the now-dead `inline_styles()` method whose CSS had already moved out in the earlier audit step — the new asset adds a `document.readyState` guard so it binds correctly whether the script lands in `<head>` or, as enqueued, the footer); (3) the audience Import/Export screen's jQuery tab-switcher → `ffc-audience-admin-import.js`; (4) the form-editor geofence metabox's two UI-wiring initializers (the Date/Time "during" row dual-gate and the geolocation area-source toggles) → `ffc-form-editor-geofence-metabox.js`; (5) the recruitment Candidates-tab CSV import handlers → `ffc-recruitment-candidates-import.js` (config via `wp_localize_script`; controls resolved through the canonical `form.elements.namedItem()` API); (6) all seven inline blocks of the recruitment Notice Edit page (CSV import-from-edit, snapshot promote, adjutancy attach/detach, classification tab switch, per-row Call / bulk-call / status transitions with out-of-order detection, and the preliminary preview-status dropdowns) → `ffc-recruitment-notice-edit.js`, with every interpolated value (REST root, nonce, per-status reason-required flags, all i18n strings) moved to a single localized object and per-instance data carried on existing `data-*` attributes. This completes the inline-JS extraction sweep.
4646
- **Internal frontend audit — large maintainability refactor (no behavior change).** Split the three monolithic frontend scripts into focused, separately-enqueued modules: `ffc-csv-download.js` (1127 LoC) → core `FFCCsv` + 6 flow modules; `ffc-audience.js` (1439) → core `FFCAudience` + calendar/bookings/booking-form; `ffc-geofence-frontend.js` (1307) → core `FFCGeofence` + datetime/gps/preflight. Extracted static inline admin CSS into the per-feature stylesheets (recruitment, settings, audience, reregistration) and the candidate-edit page's inline JS into `ffc-recruitment-candidate-edit.js`. Fragmented oversized PHP classes behind their existing public API: `RateLimitChecker` → `RateLimitRepository` (persistence), `AudienceLoader` → `AudienceAjaxController` (~13 ajax endpoints), and the recruitment admin page's row-action dispatcher → `RecruitmentAdminActions`. Removed a dead empty `ffc-calendar-admin.js` stub (+ its dead localize/nonce). Every step is covered by the existing or new JS/PHP test suites; ESLint/Stylelint/PHPStan-8/WPCS stay green and the coverage floors hold.

0 commit comments

Comments
 (0)