Skip to content

Plugin review (Phase B): rename wp-/wpdm-/wp_desktop prefixes to desktop-mode - #82

Merged
epeicher merged 3 commits into
trunkfrom
fix/plugin-review-phase-b-prefix-rename
May 4, 2026
Merged

Plugin review (Phase B): rename wp-/wpdm-/wp_desktop prefixes to desktop-mode#82
epeicher merged 3 commits into
trunkfrom
fix/plugin-review-phase-b-prefix-rename

Conversation

@epeicher

@epeicher epeicher commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Phase B of the plugin-directory review fixes. Full prefix rename to comply with the reviewer's "no wp as a prefix" rule. Single-pass rename to the project's already-canonical desktop_mode_* / desktop-mode-* / desktopMode* / DESKTOP_MODE_* family.

Old prefix New prefix
wp-desktop-* (kebab) desktop-mode-*
wp-desktop (bare URL slug + handle) desktop-mode
wpdm-* / data-wpdm-* (DOM IDs, classes, attrs) desktop-mode-* / data-desktop-mode-*
wpdm_* / _wpdm_* (PHP function names, AJAX actions, post meta, transient prefix, heartbeat fields, log prefixes) desktop_mode_* / _desktop_mode_*
wp_desktop_* / _wp_desktop_* (option keys, constants) desktop_mode_* / _desktop_mode_*
wp_desktop (chromeless query var) desktop_mode_chromeless
wpDesktop* (JS globals) desktopMode*
WP_DESKTOP_* / WPDM_* (constants) DESKTOP_MODE_*
npm package wp-desktop-mode desktop-mode
Vite env WPDM_TARGET DESKTOP_MODE_TARGET

What's in the diff

  • 276 files content-renamed across includes/, src/, assets/css/, assets/js/admin-bar.js, assets/js/media-library-enhanced.js, tests/vitest/, tests/phpunit/, docs/, vite.config.js, package.json, package-lock.json, readme.txt, README.md, AGENTS.md.
  • 13 PHPUnit test files renamed (wpDesktop*.phpdesktopMode*.php, wpAjaxSaveDesktopMode.phpdesktopModeAjaxSave.php).
  • Built bundles regenerated.

Behavior changes

  • Portal URL: /wp-desktop//desktop-mode/
  • Chromeless query flag: ?wp_desktop=1?desktop_mode_chromeless=1
  • REST namespace: wp-desktop/v1/*desktop-mode/v1/*
  • All window.wpDesktop* globals → window.desktopMode*

These are first-submission-breaking changes; the plugin isn't yet on the .org directory, so no users to migrate.

What's NOT renamed

Pre-existing PHP names that legitimately contain the substring _mode_ are kept — e.g. desktop_mode_mode_enabled, desktop_mode_mode_init. Those refer to the desktop_mode_mode user-meta toggle (Desktop Mode's "is mode enabled" state) and were already on trunk before this rename. The double-mode reads awkwardly but the names are correct as written.

Test plan

  • npm run build (all bundles)
  • npm run lint
  • tsc --noEmit
  • npm run test:js — 768 passed
  • npm run check:plugin — needs wp-env up locally; CI will run it
  • Manual: visit /desktop-mode/ portal → still flips meta and forwards into admin
  • Manual: open a window → chromeless rendering still works (uses ?desktop_mode_chromeless=1 now)
  • Manual: native windows still render (recycle bin, OS settings, etc.)
  • Manual: AI search streaming still works (renamed AJAX action)
  • Manual: presence still works (renamed option key — old presence data orphaned in DB on upgrade, ephemeral so harmless)

Stacking

This sits on top of Phase A (#81). Branched off trunk, so Phase A's commit isn't pulled in here — easy to land them in either order.

Open WordPress Playground Preview

epeicher added 2 commits May 4, 2026 17:13
Full prefix rename to comply with the WordPress.org plugin directory
review feedback that flagged "wp" as a reserved prefix. The unified
target prefix matches the project's existing canonical names:

* `wp-desktop-*`  → `desktop-mode-*`  (style/script handles, CSS classes,
                                       data attributes, postMessage types,
                                       hook channel names, REST namespace)
* `wpdm-*` / `wpdm_*` / `_wpdm_*` → `desktop-mode-*` / `desktop_mode_*`
                                       / `_desktop_mode_*`             (DOM
                                       IDs, classes, data-attrs, function
                                       names, AJAX action suffixes, post
                                       meta, transient prefix, heartbeat
                                       fields, log prefixes)
* `wp_desktop_*` / `_wp_desktop_*` → `desktop_mode_*` / `_desktop_mode_*`
                                       (option keys, constants)
* `wp_desktop` (chromeless query var) → `desktop_mode_chromeless`
* `wp-desktop` (portal URL slug)      → `desktop-mode`
* `wpDesktop*` camelCase JS globals    → `desktopMode*`
* `WP_DESKTOP_*` / `WPDM_*` constants  → `DESKTOP_MODE_*`
* npm package name `wp-desktop-mode`   → `desktop-mode`
* Vite env var `WPDM_TARGET`           → `DESKTOP_MODE_TARGET`

Affected surfaces:
- 271 PHP/TS/CSS/MD/JS files content-renamed
- 13 PHPUnit test files renamed (wpDesktop*.php → desktopMode*.php,
  wpAjaxSaveDesktopMode.php → desktopModeAjaxSave.php)
- Hand-written `assets/js/admin-bar.js` and
  `assets/js/media-library-enhanced.js` updated alongside their PHP
  enqueues
- Built bundles regenerated (`npm run build`)
- All 768 vitest tests pass; lint and tsc --noEmit clean

Documentation: every example/recipe under `docs/`, the architecture
doc, hooks reference, JS reference, bridge protocol, and the repo-
level README/AGENTS files updated to match the new prefix.

Pre-existing PHP names that legitimately contain `_mode_` (e.g.
`desktop_mode_mode_enabled` — referring to the `desktop_mode_mode`
user-meta toggle) are NOT touched; those are the canonical names
on trunk before this rename.

Behavior changes for end users:
- Portal URL: `/wp-desktop/` → `/desktop-mode/`
- Chromeless query flag: `?wp_desktop=1` → `?desktop_mode_chromeless=1`
- Both are first-submission breakers (plugin isn't published yet).
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

- desktopModePortal.php: REQUEST_URI in test_is_portal_request_detects_exact_path
  was still '/wp-desktop' (testing the OLD slug). The portal slug is
  '/desktop-mode' now — update the assertion.
- Rename remaining Tests_DesktopMode_Wp* test class names to drop the
  Wp prefix:
    Tests_DesktopMode_WpDesktopPortal       → Tests_DesktopMode_Portal
    Tests_DesktopMode_WpDesktopComponent    → Tests_DesktopMode_Component
    Tests_DesktopMode_WpAjaxSaveDesktopMode → Tests_DesktopMode_AjaxSave
    Tests_DesktopMode_WpDesktopMenuItemUrl  → Tests_DesktopMode_MenuItemUrl
    Tests_DesktopMode_WpMediaQuery          → Tests_DesktopMode_MediaQuery
    Tests_DesktopMode_WpDefaultWindow       → Tests_DesktopMode_DefaultWindow
    Tests_DesktopMode_WpDesktopBuildDockItems → Tests_DesktopMode_BuildDockItems
    Tests_DesktopMode_WpDesktopSession      → Tests_DesktopMode_Session
- Update doc comment header in desktopModePortal.php from
  `/wp-desktop` to `/desktop-mode`.
@epeicher
epeicher merged commit 2781177 into trunk May 4, 2026
8 checks passed
@epeicher
epeicher deleted the fix/plugin-review-phase-b-prefix-rename branch May 4, 2026 16:02
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