Official WordPress plugin for accepting payments through MONEI's payment gateway.
MONEI is an e-commerce payment gateway for WooCommerce that enables merchants to accept:
- Credit/Debit Cards (230+ currencies)
- Apple Pay & Google Pay
- Bizum (Spain)
- PayPal
- SEPA Direct Debit (EU)
- Multibanco & MBWay (Portugal)
- PHP 8.0 or higher
- Node.js 18 or higher
- Composer
- Yarn 4 (managed via Corepack)
- Clone the repository:
git clone git@github.com:MONEI/MONEI-WooCommerce.git
cd MONEI-WooCommerce- Install PHP dependencies:
composer install- Install Node dependencies and build assets:
yarn install
yarn buildThis project uses conventional commits to enable automated changelog generation. All commits must follow this format:
<type>: <description>
[optional body]
[optional footer]
Types:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringperf:- Performance improvementstest:- Adding or updating testsbuild:- Build system changesci:- CI/CD changeschore:- Other changes (dependencies, etc.)
Examples:
git commit -m "feat: add support for new payment method"
git commit -m "fix: resolve checkout error on mobile devices"
git commit -m "docs: update installation instructions"Commits are automatically validated by Husky + Commitlint. Invalid commit messages will be rejected.
# Development build with watch mode
yarn start
# Production build
yarn build- Ensure all changes are committed with proper conventional commit messages:
git add .
git commit -m "feat: add new payment gateway"
git push- Run the release command:
yarn releaseThis will automatically:
- ✅ Bump version in
package.json,readme.txt,.readme-template,woocommerce-gateway-monei.php, andclass-woocommerce-gateway-monei.php - ✅ Generate changelog from git conventional commits
- ✅ Update
readme.txtwith new changelog entries above manual entries - ✅ Generate
CHANGELOG.mdwith full git history - ✅ Create git tag (e.g.,
6.3.9) - ✅ Generate GitHub release notes
- ✅ Push changes and tags to GitHub
Changelog System:
- New releases with conventional commits → auto-generated entries at the top
- Historical releases → manual entries preserved below
.readme-templatecontains{{__PLUGIN_CHANGELOG__}}placeholdergenerate-wp-readmereplaces placeholder with git commit history- Manual changelog entries remain intact below the auto-generated section
- CI/CD takes over:
- GitHub Actions builds the plugin
- Deploys to WordPress.org
- Attaches plugin ZIP to GitHub release
Test the release process without making changes:
yarn release --dry-runTo specify a version manually:
yarn release --increment patch # 6.3.8 → 6.3.9
yarn release --increment minor # 6.3.8 → 6.4.0
yarn release --increment major # 6.3.8 → 7.0.0
yarn release 6.4.0 # Specific version├── assets/ # Source files (JS/CSS)
│ ├── js/ # JavaScript sources
│ └── css/ # CSS sources
├── public/ # Built assets (generated, gitignored)
│ ├── js/ # Built JavaScript
│ ├── css/ # Built CSS
│ └── images/ # Static images (tracked in git)
├── src/ # PHP source code
├── includes/ # PHP includes
├── .husky/ # Git hooks
│ └── commit-msg # Commitlint hook
├── .github/workflows/ # CI/CD workflows
├── package.json # Node dependencies & scripts
├── composer.json # PHP dependencies
└── readme.txt # WordPress.org plugin readme
The project uses automated linting and code quality tools to maintain consistent code style and catch bugs early:
- JavaScript/CSS: ESLint + Stylelint (via
@wordpress/scripts) - PHP: PHPCS (WordPress Coding Standards) + PHPStan (static analysis)
- Git Hooks: Husky + lint-staged for automatic fixing
- Commit Messages: Commitlint (conventional commits)
Pre-commit Hook:
- Auto-fixes staged files with
lint-staged - PHP:
phpcbf(auto-fix code style) +phpstan(static analysis) - JavaScript:
eslint --fix - CSS:
stylelint --fix - Prevents committing broken code by running PHPStan
Commit-msg Hook:
- Validates commit message format (conventional commits)
Pre-push Hook:
- Branch Protection: Blocks direct pushes to
master/mainbranches
# Auto-fix all issues at once (recommended)
yarn lint:fix
# Individual fixers
yarn lint:js-fix # Fix JavaScript issues
yarn lint:css-fix # Fix CSS issues
yarn lint:php:fix # Fix PHP code style issues (phpcbf)
# Linters only (no auto-fix)
yarn lint # Check all (JS + CSS + PHP)
yarn lint:js # Check JavaScript
yarn lint:css # Check CSS
yarn lint:php # Check PHP (PHPCS + PHPStan)
yarn lint:php:phpcs # Check PHP code style only
yarn lint:php:phpstan # Check PHP static analysis only- Before committing: Run
yarn lint:fixto auto-fix all issues - During commit: Hooks auto-fix staged files, run PHPStan, and validate commit message
- If commit fails: Fix PHPStan errors and commit again
- Before push: Branch protection check ensures you're not pushing to master
.lintstagedrc.json- Auto-fix configuration for staged files.eslintrc.js- JavaScript linting rules.eslintignore- Excludepublic/build outputs from JS linting.stylelintignore- Excludepublic/build outputs from CSS lintingphpcs.xml- PHP code style rules (WordPress standards)phpstan.neon- PHP static analysis configuration (Level 4)commitlint.config.js- Commit message validation rules
PHPStan analyzes PHP code for type errors and bugs without running it:
# Run PHPStan manually
composer phpstan
# Or via yarn
yarn lint:php:phpstanCommon PHPStan errors:
- Missing type hints in docblocks
- Calling undefined methods
- Type mismatches in function parameters
- Unreachable code
Configuration: phpstan.neon (Level 4)
- WordPress/WooCommerce function stubs included
- Bootstrap file for plugin constants
PHPCS checks PHP code against WordPress Coding Standards:
# Check code style
composer phpcs
yarn lint:php:phpcs
# Auto-fix code style issues
composer phpcbf
yarn lint:php:fixConfiguration: phpcs.xml
- WordPress-Core ruleset
- Tabs for indentation
- PSR-4 autoloading compatible
Direct pushes to master/main branches are blocked by the pre-push hook:
# ❌ This will fail:
git checkout master
git push origin master
# ✅ Instead, use feature branches:
git checkout -b feat/my-feature
git push origin feat/my-feature
# Then create a Pull Request on GitHubyarn build- Build production assetsyarn start- Development build with watch modeyarn release- Create new release (automated versioning)yarn lint- Lint all files (JS + CSS + PHP)yarn lint:fix- Auto-fix all linting issuesyarn lint:js- Lint JavaScriptyarn lint:js-fix- Fix JavaScript linting issuesyarn lint:css- Lint CSSyarn lint:css-fix- Fix CSS linting issuesyarn lint:php- Lint PHP (PHPCS + PHPStan)yarn lint:php:fix- Fix PHP code style issues
- Build Tool: Webpack (via @wordpress/scripts)
- Package Manager: Yarn 4 (Berry)
- Commit Linting: Commitlint + Husky
- Release Automation: release-it + generate-wp-readme
- Changelog: Auto-generated from conventional commits
-
WordPress.org Deployment (
.github/workflows/main.yml)- Triggers on GitHub release creation
- Builds assets, deploys to WordPress.org
- Attaches ZIP to GitHub release
-
Manual Package Creation (
.github/workflows/create-package.yml)- Manually triggered via Actions UI
- Creates installable plugin ZIP
- Fork the repository
- Create a feature branch:
git checkout -b feat/my-feature - Make changes using conventional commits
- Push and create a Pull Request
- Documentation: https://support.monei.com
- Email: support@monei.com
- WordPress.org: https://wordpress.org/plugins/monei/
GPLv2 or later