Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/logicduke/eds-demo-palette-switcher/archive/refs/heads/main.zipLets visitors to Elite Digital Solutions demo sites temporarily preview the color palettes that the active EDS theme provides.
Scope: color palettes only. The plugin never touches typography, layout, section order, animations, headers, button shapes, border radius, content, or images.
The theme owns the palettes. The plugin only receives what the theme registers, displays it, and applies the visitor's choice client-side through localStorage. There are no database writes, no Customizer or option changes, and no page reloads, so it stays safe behind full-page caches such as Cloudflare. The plugin ships no palettes of its own.
Status: v0.1.0. The integration contract, the client-side preview and the responsive switcher control. Themes integrate themselves through the API below.
Admin setting
There is one setting: Settings → General → Demo Palette Switcher → Enable Demo Palette Switcher.
- It is off by default.
- It is stored in the
eds_dps_enabledoption as'1'or'0', and saved through the WordPress Settings API, which requiresmanage_options. - Visitors never write to it.
- Uninstalling the plugin (Delete on the Plugins screen) removes this option. Nothing else is removed, because nothing else is stored; theme settings and palette definitions belong to the theme.
When the frontend runs
The plugin prints nothing unless all of the following are true:
- the setting is enabled;
eds_dps_get_integration()returns a valid integration;- that integration has at least one palette;
- the request is not a Customizer preview (there, a stored visitor choice must not mask the palette being edited).
Otherwise the plugin is inert and the theme renders exactly as it would without it.
How the preview works
No-flash bootstrap
A tiny inline script runs at wp_head priority 1, before the theme's styles. It:
- reads
localStorage['eds-dps:<integration_id>']; - applies it as
<html data-eds-demo-palette="<id>">, but only if the stored value is one of the registered palette IDs that PHP printed into the page.
If storage is unavailable or the stored value is unknown, it does nothing. It never throws and never waits for other scripts. The same inline script also exposes the page configuration as window.edsDemoPalette.
Palette CSS
A `