✅ Plugin Zip Created: - File: woonoow.zip - Size: 1.4MB (compressed) - Location: /wp-content/plugins/woonoow.zip 📝 Created PLUGIN_ZIP_GUIDE.md: - Step-by-step zipping process - What to include/exclude - Size optimization tips - Testing checklist - Automated script template - Version management guide ✅ Zip Contents: - All PHP files (includes/, *.php) - Admin SPA build (admin-spa/dist/) - Assets (icons, templates) - Main plugin file (woonoow.php) - README.md only (no other docs) ❌ Excluded from Zip: - node_modules/ - admin-spa/src/ (source files) - .git/ - All .md docs (except README.md) - package.json, composer.json - Dev config files 🎯 Ready for Distribution!
4.2 KiB
4.2 KiB
Plugin Zip Guide
Overview
This guide explains how to properly zip the WooNooW plugin for distribution.
What to Include
✅ Include
- All PHP files (
includes/,*.php) - Admin SPA build (
admin-spa/dist/) - Assets (
assets/) - Languages (
languages/) - README.md
- LICENSE (if exists)
- woonoow.php (main plugin file)
❌ Exclude
node_modules/admin-spa/src/(source files, only include dist).git/.gitignore- All
.mddocumentation files (except README.md) composer.json,composer.lockpackage.json,package-lock.json.DS_Store,Thumbs.db- Development/testing files
Step-by-Step Process
1. Build Admin SPA
cd admin-spa
npm run build
This creates optimized production files in admin-spa/dist/.
2. Create Zip (Automated)
# From plugin root directory
zip -r woonoow.zip . \
-x "*.git*" \
-x "*node_modules*" \
-x "admin-spa/src/*" \
-x "*.md" \
-x "!README.md" \
-x "composer.json" \
-x "composer.lock" \
-x "package.json" \
-x "package-lock.json" \
-x "*.DS_Store" \
-x "Thumbs.db"
3. Verify Zip Contents
unzip -l woonoow.zip | head -50
Required Structure
woonoow/
├── admin-spa/
│ └── dist/ # ✅ Built files only
├── assets/
│ ├── css/
│ ├── js/
│ └── images/
├── includes/
│ ├── Admin/
│ ├── Api/
│ ├── Core/
│ └── ...
├── languages/
├── README.md # ✅ Only this MD file
├── woonoow.php # ✅ Main plugin file
└── LICENSE (optional)
Size Optimization
Before Zipping
- ✅ Build admin SPA (
npm run build) - ✅ Remove source maps if not needed
- ✅ Ensure no dev dependencies
Expected Size
- Uncompressed: ~5-10 MB
- Compressed (zip): ~2-4 MB
Testing the Zip
1. Extract to Test Environment
unzip woonoow.zip -d /path/to/test/wp-content/plugins/
2. Verify
- Plugin activates without errors
- Admin SPA loads correctly
- All features work
- No console errors
- No missing files
3. Check File Permissions
find woonoow -type f -exec chmod 644 {} \;
find woonoow -type d -exec chmod 755 {} \;
Distribution Checklist
- Admin SPA built (
admin-spa/dist/exists) - No
node_modules/in zip - No
.git/in zip - No source files (
admin-spa/src/) in zip - No documentation (except README.md) in zip
- Plugin version updated in
woonoow.php - README.md updated with latest info
- Tested in clean WordPress install
- All features working
- No errors in console/logs
Version Management
Before Creating Zip
-
Update version in
woonoow.php:* Version: 1.0.0 -
Update version in
admin-spa/package.json:"version": "1.0.0" -
Tag in Git:
git tag -a v1.0.0 -m "Release v1.0.0" git push origin v1.0.0
Automated Zip Script
Save as create-zip.sh:
#!/bin/bash
# Build admin SPA
echo "Building admin SPA..."
cd admin-spa
npm run build
cd ..
# Create zip
echo "Creating zip..."
zip -r woonoow.zip . \
-x "*.git*" \
-x "*node_modules*" \
-x "admin-spa/src/*" \
-x "*.md" \
-x "!README.md" \
-x "composer.json" \
-x "composer.lock" \
-x "package.json" \
-x "package-lock.json" \
-x "*.DS_Store" \
-x "Thumbs.db" \
-x "create-zip.sh"
echo "✅ Zip created: woonoow.zip"
echo "📦 Size: $(du -h woonoow.zip | cut -f1)"
Make executable:
chmod +x create-zip.sh
./create-zip.sh
Troubleshooting
Issue: Zip too large
Solution: Ensure node_modules/ is excluded
Issue: Admin SPA not loading
Solution: Verify admin-spa/dist/ is included and built
Issue: Missing files error
Solution: Check all required files are included (use unzip -l)
Issue: Permission errors
Solution: Set correct permissions (644 for files, 755 for dirs)
Final Notes
- Always test the zip in a clean WordPress environment
- Keep source code in Git, distribute only production-ready zip
- Document any special installation requirements in README.md
- Include changelog in README.md for version tracking