Plugin review (Phase B): rename wp-/wpdm-/wp_desktop prefixes to desktop-mode - #82
Merged
Merged
Conversation
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).
…ase-b-prefix-rename
Contributor
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
9 tasks
- 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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase B of the plugin-directory review fixes. Full prefix rename to comply with the reviewer's "no
wpas a prefix" rule. Single-pass rename to the project's already-canonicaldesktop_mode_*/desktop-mode-*/desktopMode*/DESKTOP_MODE_*family.wp-desktop-*(kebab)desktop-mode-*wp-desktop(bare URL slug + handle)desktop-modewpdm-*/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_chromelesswpDesktop*(JS globals)desktopMode*WP_DESKTOP_*/WPDM_*(constants)DESKTOP_MODE_*wp-desktop-modedesktop-modeWPDM_TARGETDESKTOP_MODE_TARGETWhat's in the diff
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.wpDesktop*.php→desktopMode*.php,wpAjaxSaveDesktopMode.php→desktopModeAjaxSave.php).Behavior changes
/wp-desktop/→/desktop-mode/?wp_desktop=1→?desktop_mode_chromeless=1wp-desktop/v1/*→desktop-mode/v1/*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 thedesktop_mode_modeuser-meta toggle (Desktop Mode's "is mode enabled" state) and were already on trunk before this rename. The double-modereads awkwardly but the names are correct as written.Test plan
npm run build(all bundles)npm run linttsc --noEmitnpm run test:js— 768 passednpm run check:plugin— needs wp-env up locally; CI will run it/desktop-mode/portal → still flips meta and forwards into admin?desktop_mode_chromeless=1now)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.