This document explains how to build, develop, and maintain this WordPress plugin.
git clone https://github.com/Starisian-Technologies/sparxstar-gluon.git
cd sparxstar-gluon
composer install
npm install
npx playwright install
src/
├── js/ # Source JavaScript files
├── css/ # Source CSS files
├── core/ # Core PHP classes
├── helpers/ # Helper PHP classes
├── includes/ # Autoloader and includes
├── integrations/# Third-party integrations
└── templates/ # Template files
assets/
├── js/ # Minified JavaScript (generated)
└── css/ # Minified CSS (generated)
# Lint all code
npm run lint
composer run lint:php
# Fix auto-fixable issues
npm run format
composer run fix:php
# Run tests
npm test
composer run test:php
# Build assets for production
npm run build
# Build JS only
npm run build:js
# Build CSS only
npm run build:css
# Generate translation files
npm run makepot
# Run Rector refactoring (dry-run)
composer run refactor:php
# Apply Rector refactoring
composer run refactor:php:fix
JavaScript files are minified using Terser:
npm run build:js
This will:
.js files from src/js/assets/js/ as .min.js filesCSS files are minified using clean-css:
npm run build:css
This will:
.css files from src/css/assets/css/ as .min.css filesRun both JS and CSS builds:
npm run build
# Run all PHPUnit tests
composer run test:php
# Run specific test file
./vendor/bin/phpunit tests/phpunit/ExampleTest.php
# Run all Jest tests
npm test
# Run in watch mode
npm test -- --watch
# Generate coverage report
npm test -- --coverage
# Run all E2E tests
npm run test:e2e
# Run specific browser
npx playwright test --project=chromium
# Run in headed mode (see browser)
npx playwright test --headed
# Debug mode
npx playwright test --debug
Puppeteer is available for custom browser automation. See tests/e2e/ for examples.
Checks code against WordPress coding standards:
composer run lint:php
Fix auto-fixable issues:
composer run fix:php
Configuration: phpcs.xml.dist
Analyzes code for type errors and bugs:
composer run analyze:php
Configuration: phpstan.neon.dist
Modernizes PHP code and applies best practices:
# Dry run (preview changes)
composer run refactor:php
# Apply changes
composer run refactor:php:fix
Configuration: rector.php
Lints JavaScript code:
npm run lint:js
Configuration: eslint.config.js
Lints CSS code:
npm run lint:css
Configuration: .stylelintrc.json
Generate POT file for translations:
npm run makepot
This creates/updates languages/plugin-textdomain.pot with all translatable strings.
git tag -a v1.2.3 -m "Release version 1.2.3"
git push origin v1.2.3
The GitHub Actions workflow will automatically:
sparxstar-plugin-entry.php (plugin header, @version, GLUON_PLUGIN_VERSION)package.jsoncomposer.json (if version field exists)npm run build
npm run makepot
# Install production dependencies only
composer install --no-dev --optimize-autoloader
# Create zip excluding dev files
# Use .distignore to exclude files
Runs on every push and pull request:
Weekly security scans:
If builds fail, try:
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install
# Clear composer cache
composer clear-cache
composer install
# Reinstall Playwright browsers
npx playwright install --force
# Clear Jest cache
npm test -- --clearCache
# Auto-fix what's possible
npm run format
composer run fix:php
# Check what can't be auto-fixed
npm run lint
composer run lint:php
For issues and questions:
docs/