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/spkcd/leafwp-2/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Provides a client portal for LeafWP clients, integrated into WordPress.
Features
- Adds a "Client Portal" admin menu.
- Provides a
[leafwp_client_portal]shortcode to display the portal on the frontend. - Loads a React/Vue frontend application from the
build/directory. - Structured for future module additions (Support, Analytics, etc.).
Structure
leafwp-client-portal.php: Main plugin file.includes/: Contains core PHP classes.class-leafwp-client-portal.php: Core plugin orchestrator.admin/class-leafwp-admin.php: Handles admin area functionality.frontend/class-leafwp-frontend.php: Handles frontend functionality (shortcode, scripts).
templates/: Contains template files.admin/settings-page.php: Template for the admin settings page.frontend/shortcode-output.php: Template for the shortcode output (container for the JS app).
build/: Contains the built frontend JavaScript and CSS assets (e.g., from Vite, Webpack, Parcel)..gitkeep: Placeholder to ensure directory exists.
languages/: Contains translation files (.pot,.po,.mo)..gitignore: Specifies intentionally untracked files that Git should ignore.README.md: This file.
Frontend Development
- Choose your preferred framework (React, Vue, Svelte, etc.).
- Set up your build process (Vite, Webpack, Parcel, etc.) to output:
- A CSS file (e.g.,
build/assets/index.css) - A JS file (e.g.,
build/assets/index.js)
- A CSS file (e.g.,
- Develop your frontend application. It should mount itself to the
#leafwp-client-portal-appdiv provided by the shortcode template. - Use the
leafwpCpDataJavaScript object (localized viawp_localize_script) to access WordPress data like API endpoints, nonces, etc. - Run your build command.
Installation
- Upload the
leafwp-client-portalfolder to the/wp-content/plugins/directory. - Activate the plugin through the 'Plugins' menu in WordPress.
- Add the shortcode
[leafwp_client_portal]to any page or post where you want the client portal to appear. - Navigate to "Client Portal" in the WordPress admin menu to configure settings (future functionality).