Build commands, code style guidelines, and project structure for UniFi Portal WordPress plugin development with Vue.js frontend and PHP backend
This skill has safety concerns that you should review before use. Some patterns were detected that may pose a risk.Safety score: 60/100.
KillerSkills scans all public content for safety. Use caution before installing or executing flagged content.
A comprehensive guide for developing the UniFi Portal WordPress plugin with Vue.js frontend and PHP backend.
Provides build commands, code style guidelines, testing workflows, and architectural patterns for UniFi Portal development. Ensures consistent code quality across PHP (PSR-12/WordPress standards) and Vue.js (Composition API) components.
When the user needs to build or run the project:
1. **Frontend Development**
- Run `yarn dev` to start the dev server with hot module replacement
- Run `yarn prod` to build optimized production bundles
2. **PHP Backend**
- Run `composer dev` to optimize autoloader for development
- Run `composer prod` to install dependencies and optimize for production
3. **Testing**
- Run `composer test` to execute all PHPUnit tests
- Run `composer test tests/SpecificTest.php` to run a single test file
- Run `composer phpcs` to check code style with PHP CodeSniffer
- Run `composer phpcbf` to automatically fix code style issues
When writing or reviewing code:
**PHP Files:**
**Vue.js Components:**
**CSS/SCSS:**
When creating new features or refactoring:
1. **PHP Structure**
- Organize classes under PSR-4 namespaced directories in `src/`
- Use autoloader for all class imports (no manual requires)
- Group related classes by feature/domain
2. **Frontend Structure**
- Place Vue components in `src/frontend/templates/unifi-portal`
- Organize by feature when project grows
3. **Tests**
- Write PHPUnit tests in `tests/` directory
- Mirror the namespace structure of source files
- Test both success and failure scenarios
Always apply these security measures:
Implement consistent error handling:
```bash
composer phpcs && composer test
```
```bash
yarn prod && composer prod
```
Follow PSR-4 autoloading structure:
Use Composition API with clear documentation:
```vue
<script setup>
// Component: UserProfile
// Purpose: Displays user information and settings
import { ref, computed } from 'vue'
const userName = ref('')
const isAdmin = computed(() => checkAdminRole())
</script>
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/unifi-portal-development/raw