Custom WordPress admin dashboard built with React and WP REST API — demonstrates modern Gutenberg-era frontend skills while keeping WordPress as the core platform.
Author: Midas Moradi
| Feature | Description |
|---|---|
| Custom Dashboard | Full React SPA inside WP admin |
| Analytics Widgets | Posts, users, comments, media stats |
| React Components | StatCard, AnalyticsChart, ActivityFeed, RecentPosts |
| WP REST API | Custom wpra/v1 endpoints + @wordpress/api-fetch |
| OOP PHP Backend | PSR-4, service container, security layer |
After activation, visit React Dashboard in the admin menu.
PHP (src/) React (assets/src/)
├── Api/ ├── components/
│ ├── AnalyticsRestController ├── Dashboard.jsx
│ └── PostsRestController ├── StatCard.jsx
├── Admin/DashboardRegistrar ├── AnalyticsChart.jsx
└── Container/ └── api/client.js
- WordPress 6.4+
- PHP 8.1+
- Node.js 18+ (for building assets)
- Composer
git clone https://github.com/midasmoradi/wp-react-admin.git
cd wp-react-admin
composer install --no-devThe build/ folder is included — no npm build required to run.
Activate the plugin. Open React Dashboard from the admin sidebar.
npm start # Hot reload during development
npm run build # Production build → build/
composer phpcs # PHP standards| Method | Endpoint | Description |
|---|---|---|
| GET | /wp-json/wpra/v1/analytics/overview |
Site stats overview |
| GET | /wp-json/wpra/v1/analytics/posts-chart |
Posts per month |
| GET | /wp-json/wpra/v1/analytics/activity |
Recent activity feed |
| GET | /wp-json/wpra/v1/analytics/content-breakdown |
Content by post type |
| GET | /wp-json/wpra/v1/posts/recent |
Recent posts with meta |
All endpoints require edit_posts capability.
- React 18 via
@wordpress/element - @wordpress/components — Spinner, Notice
- @wordpress/api-fetch — Authenticated REST requests
- @wordpress/scripts — Build tooling (same as Gutenberg blocks)
- PHP 8.1 OOP backend with DI container
GPL v2 or later.