WP Manifestindependent plugin directory
manifest / users / leafwp-2

LeafWP Client Portal

Provides a client portal for LeafWP clients.

★ 0stars

Install

Download source zip No release zip yet

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.zip
No 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

  1. Choose your preferred framework (React, Vue, Svelte, etc.).
  2. 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)
  3. Develop your frontend application. It should mount itself to the #leafwp-client-portal-app div provided by the shortcode template.
  4. Use the leafwpCpData JavaScript object (localized via wp_localize_script) to access WordPress data like API endpoints, nonces, etc.
  5. Run your build command.

Installation

  1. Upload the leafwp-client-portal folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Add the shortcode [leafwp_client_portal] to any page or post where you want the client portal to appear.
  4. Navigate to "Client Portal" in the WordPress admin menu to configure settings (future functionality).