This repository contains the monorepo for the Leat WordPress/WooCommerce integration plugin and its related components. This plugin serves as a middleware layer connecting WordPress and WooCommerce stores to the Leat CRM platform.
Leat is a standalone software solution for customer loyalty and email marketing. This integration plugin enables WordPress and WooCommerce users to connect their stores to the Leat platform, allowing them to leverage Leat's loyalty program, rewards, and marketing automation features both online and in-store.
The project uses a monorepo structure with Turborepo to manage the various components:
- WordPress Plugin: The main integration plugin for WordPress
- Admin Interface: Svelte-based admin dashboard for configuration
- Frontend Components: Customer-facing components for the loyalty program
- WooCommerce Blocks: Custom blocks for WooCommerce integration
- Shared Libraries: Common utilities and types used across the project
- Backend: PHP 8.0+
- Frontend: TypeScript, Svelte, React (WooCommerce Blocks)
- Build Tools: Vite, Turborepo, PNPM
- Testing: No tests yet.
- Styling: The admin interface uses TailwindCSS, the frontend uses vanilla CSS.
To set up the development environment, follow these steps:
- Node.js 22.x or higher
- PNPM 9.x or higher
- PHP 8.0 or higher (64-bit)
- WordPress 6.0+ development environment
- WooCommerce 6.9+
- Leat account (for API access)
- Clone this repository
- Install dependencies:
pnpm install
In the apps/plugin
folder, you may need to ensure that the scripts are executable. Run the following command:
chmod +x ./bin/*
These scripts are used to build the plugin.
It's often easier to symlink the plugin into your WordPress environment rather than clone the entire repository inside the plugins
folder.
To create a symbolic link to your plugin in a WordPress environment, do the following:
- Navigate to your WordPress plugin folder. For example:
cd /path/to/wordpress/wp-content/plugins
- Run the following command to create the symlink:
ln -s /path/to/leat/apps/plugin leat
This will create a symlink called leat
in your WordPress plugins directory, pointing to the Leat plugin within your development environment.
The project uses Turborepo to manage the build process and dependencies between packages. Here are some common commands:
# Start development server for all packages
pnpm dev
# Start development server for admin interface only
pnpm dev:admin
# Start development server for frontend components only
pnpm dev:frontend
# Build all packages
pnpm build
# Package the plugin for distribution
pnpm package-plugin
# Run type checking
pnpm typecheck
# Format code
pnpm format
# Lint code
pnpm lint
apps/plugin/
- The main WordPress integration pluginpackages/plugin-admin/
- Admin interface componentspackages/plugin-frontend/
- Frontend components for customerspackages/wc-blocks/
- WooCommerce block integrationspackages/types/
- Shared TypeScript typespackages/lib/
- Shared utilities and libraries
This plugin connects WordPress/WooCommerce to the Leat platform, enabling:
- Customer Synchronization: Automatically sync WordPress users with Leat CRM
- Order Tracking: Send order data to Leat for points calculation and reward triggers
- Reward Redemption: Allow customers to redeem Leat rewards in your WooCommerce store
- Loyalty Widget Integration: Display loyalty program information to customers
- Admin Configuration: Manage Leat connection settings from WordPress admin
- WooCommerce Checkout Integration: Apply rewards and collect loyalty information during checkout
This plugin requires an API connection to Leat and its business portal (business.leat.eu) for core functionality. The plugin acts as a middleware layer, transmitting data between your WordPress site and the Leat platform.
Data transmitted includes:
- Customer information (email, name, order history, purchase categories)
- WooCommerce order data (order totals, products purchased, dates)
- Store configuration data
- Reward and voucher definitions
- Store performance metrics and analytics
All data is transmitted securely via HTTPS to Leat's servers in compliance with GDPR and other applicable privacy regulations.
We welcome contributions! Please read our Contributing Guidelines before submitting pull requests.
This integration plugin is licensed under the GPL v2 or later - see the LICENSE file for details.
To create a new release of the Leat WordPress Integration plugin, follow these steps:
Add your changelog entries to apps/plugin/readme.txt
in the Changelog section. Follow the existing format:
= x.x.x =
* Feature: Description of new feature
* Enhancement: Description of enhancement
* Bug fix: Description of bug fix
Update the version number in the following files:
apps/plugin/package.json
: Update the"version"
fieldapps/plugin/leat-crm.php
: Update both theVersion:
and theLEAT_VERSION
constantapps/plugin/readme.txt
: Update theStable tag:
field in the readme header
Generate the POT file for translations:
cd apps/plugin
pnpm run i18n
This will create/update the languages/leat.pot
file with the latest translatable strings.
Build and package the plugin to ensure everything works correctly:
pnpm build
pnpm package-plugin
Commit all your changes with a descriptive message:
git add .
git commit -m "chore: bump version to x.x.x"
-
Create a new tag matching your version number:
git tag vx.x.x git push origin vx.x.x
-
Go to GitHub and create a new release using the tag you just pushed.
- Title: Version x.x.x
- Description: Copy the changelog entries for this version
The GitHub workflow will automatically deploy the plugin to the WordPress.org plugin repository when you publish the release. The workflow:
- Builds the plugin
- Packages it for distribution
- Deploys it to WordPress.org
- Attaches the zip file to the GitHub release
If the deployment fails, check:
- GitHub Actions logs for any errors
- Ensure the SVN_USERNAME and SVN_PASSWORD secrets are correctly set in the repository
- Verify that the version numbers are consistent across all files