An experimental WordPress plugin focused on REST-driven data flow, JSON-based configuration, and custom admin interfaces, demonstrated through an interactive periodic table.
This project is a development-oriented plugin that brings together several modern WordPress patterns in a single, cohesive example.
It combines a dynamic Gutenberg block, shared PHP rendering, REST-based data flow, and a JSON-driven configuration layer. The periodic table UI is used as a practical demonstration of these concepts, rather than a full scientific dataset.
The plugin also includes an experimental admin interface built with @wordpress/dataviews, featuring schema-assisted form generation and a draft/publish workflow for managing data.
- Dynamic Gutenberg block with PHP render
- Shared rendering template usable outside of the block context
- Support for wide and full alignment
- Optional UI controls for property and color mode selection
- JSON-based data sources (
elements.json,colors.json) - Schema-driven configuration (
element-schema.json) - Single source of truth with database overrides
- REST endpoints for frontend data and admin actions
- Settings page with separate sections for colors and elements
- Experimental UI built with
@wordpress/dataviewsand DataForm - Schema-generated form fields (including enum handling and read-only flags)
- Modal-based editing for individual elements
- Draft / publish workflow for both colors and elements
- Discard changes and reset to original JSON source
- Published data stored in WordPress options
- Automatic fallback to JSON when no database data is present
- Modular JavaScript
- Custom events for UI interaction
- Dynamic legend and property-based coloring
- Element preview panel on interaction
- Keyboard navigation support
- Light/dark mode with system preference awareness
- Centralized SCSS shared between block and frontend
- Download or clone the repository.
- Copy the plugin folder to your WordPress
wp-content/pluginsdirectory. - Activate the plugin from the WordPress admin panel.
The plugin includes prebuilt assets and works out of the box.
Source files are located in the assets-src/ and blocks/ directories.
To work on the project locally:
npm install
npm run start:allTo build assets:
npm run build:allIndividual build targets:
npm run frontend:start
npm run editor:start
npm run settings:start
npm run blocks:startBuild output is written to the build/ directory.
assets-src/
js/
frontend/
editor/
settings/
shared/
scss/
blocks/
build/
inc/
json/
templates/
languages/
assets-src/js/frontend– frontend behavior and UI logicassets-src/js/editor– block editor integrationassets-src/js/settings– admin settings interfaceassets-src/js/shared– shared modulesblocks– Gutenberg block source filesinc– PHP classes and plugin bootstrapjson– data sources and schema definitionstemplates– shared rendering templatesbuild– compiled assets (included in repo)
The plugin uses JSON files as its primary data source:
elements.json– basic element datacolors.json– color schemes for different properties and modeselement-schema.json– schema used to generate admin form fields
In the admin interface:
- changes are stored as drafts in the database
- published data overrides the JSON source
- resetting removes database data and restores JSON defaults
- This is an experimental project intended as a development showcase.
- The included dataset was manually curated from commonly available public chemistry references and is intended as a lightweight demo dataset rather than a canonical scientific source.
- The admin interface is based on
@wordpress/dataviews, which is still evolving and may change in future WordPress versions.