Thank you for contributing to OpenFields! This guide will help you get started.
git clone https://github.com/novincode/openfields.git
cd openfieldspnpm install
# or: npm installpnpm run wp-env:start
# WordPress will be at http://localhost:8888
# Admin: http://localhost:8888/wp-admin (user: admin / pass: password)pnpm run dev
# This starts Vite dev server with hot reloadFiles to edit: admin/src/**/*.tsx
# The changes will auto-reload in the browser
pnpm run dev
# When ready, build the plugin:
pnpm run build:pluginFiles to edit: plugin/includes/**/*.php
- Rebuild the plugin to test:
pnpm run build:plugin - Changes take effect when you reload WordPress
Files to edit: docs/**/*.md
- Test the markdown renders correctly on GitHub
- Link to related docs where relevant
- Use
openfields_prefix for all functions and hooks - Follow WordPress Coding Standards
- Include proper sanitization and escaping
- Add PHPDoc comments to classes and functions
Check compliance:
composer test- All code must be TypeScript (no plain JS)
- Run ESLint before committing
Fix issues automatically:
pnpm run lint:fix
pnpm run format- Start the dev environment:
pnpm run wp-env:start - Go to http://localhost:8888/wp-admin
- Test your changes manually
- Build for testing:
pnpm run build:plugin
pnpm run test # Run tests
pnpm run test:ui # Test UI (browser)
pnpm run type-check # TypeScript checking-
Build the plugin to ensure no errors:
pnpm run build:plugin
-
Run type checking:
pnpm run type-check
-
Run linting & format:
pnpm run lint:fix pnpm run format
Write clear, descriptive commit messages:
git commit -m "feat: Add field conditional logic to repeaters"
git commit -m "fix: Switch field styling in admin"
git commit -m "docs: Update API reference for get_field()"- Push to your fork
- Create PR to
mainbranch - Include a clear description of changes
- Link any related issues
openfields/
├── admin/ # React admin interface
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── pages/ # Admin pages
│ │ └── stores/ # Zustand state
│ └── dist/ # Built output
│
├── plugin/ # WordPress plugin
│ ├── openfields.php # Main plugin file
│ ├── includes/
│ │ ├── class-openfields-*.php # Core classes
│ │ ├── admin/ # Admin functionality
│ │ ├── fields/ # Field types
│ │ └── storage/ # Data layer
│ ├── assets/ # CSS/JS (auto-generated)
│ └── languages/ # Translations
│
├── docs/ # Documentation
│ ├── BUILD.md
│ ├── ARCHITECTURE.md
│ ├── DEVELOPER_GUIDE.md
│ └── ...
│
└── package.json
When adding features, update the relevant documentation:
- API changes →
docs/DEVELOPER_GUIDE.md - Architecture changes →
docs/ARCHITECTURE.md - Setup/installation →
README.md - Build process →
docs/BUILD.md
Link between docs using relative paths:
See [ARCHITECTURE.md](./ARCHITECTURE.md) for more details.
See [Build System](../docs/BUILD.md) for building.# Development
pnpm run dev # Start dev server
pnpm run wp-env:start # Start WordPress
pnpm run wp-env:stop # Stop WordPress
# Building
pnpm run build # Build React admin app
pnpm run build:plugin # Build plugin (dev)
pnpm run build:plugin:release # Build plugin (release ZIP)
# Code Quality
pnpm run type-check # TypeScript check
pnpm run lint # ESLint check
pnpm run lint:fix # Auto-fix linting
pnpm run format # Prettier formatting
# Testing
pnpm run test # Run tests
pnpm run test:ui # Test UI in browser- 📖 Check DEVELOPER_GUIDE.md for API reference
- 📐 Check ARCHITECTURE.md for technical details
- 💬 Open an issue on GitHub
- Be respectful and inclusive
- Help others learn
- Share knowledge openly
- Report issues responsibly
Thank you for making OpenFields better! 🚀