# Emporio Sport - Final Deployment Checklist

## ✅ Pre-Deployment Verification (Complete Before Upload)

### Code & Files
- [ ] All PHP files present and syntax correct
- [ ] All CSS files present and valid
- [ ] All JavaScript files present
- [ ] `.htaccess` file included
- [ ] `/data/` folder with JSON files
- [ ] Image folders (`/pics_ecom/`, `/sport-pics/`) with all images

### JSON Data Validation
- [ ] `/data/products.json` - Valid JSON, 19+ products
- [ ] `/data/categories.json` - Valid JSON, 12+ categories
- [ ] `/data/pages.json` - Valid JSON with id, title, url, is_featured fields
- [ ] All image paths in JSON match actual files
- [ ] No corrupted or incomplete JSON

### Functionality Testing (Localhost)
- [ ] Homepage loads
  - [ ] Logo displays
  - [ ] Navigation shows
  - [ ] Featured products visible
  
- [ ] Shop page works
  - [ ] All products load
  - [ ] Product images display
  - [ ] Filters work (category, price, rating)
  - [ ] Pagination appears when needed
  - [ ] Product detail page works
  
- [ ] Navigation
  - [ ] Featured pages show in header
  - [ ] "MORE" dropdown appears on hover
  - [ ] All pages link correctly
  
- [ ] Footer
  - [ ] Displays at bottom of all pages
  - [ ] Links work
  - [ ] Not cut off

### Browser Testing
- [ ] Chrome latest version
- [ ] Firefox latest version
- [ ] Safari latest version
- [ ] Mobile browser (phone/tablet)
- [ ] Console clear (F12 > Console) - no JavaScript errors
- [ ] Network tab clear - no 404 errors for resources

### Mobile Responsiveness
- [ ] Mobile (360px width)
  - [ ] Navigation hamburger menu works (if applicable)
  - [ ] Products stack vertically
  - [ ] All text readable
  
- [ ] Tablet (768px width)
  - [ ] 2-column product grid
  - [ ] Sidebar shows
  - [ ] All buttons tappable (min 44px)
  
- [ ] Desktop (1920px width)
  - [ ] 3-4 column product grid
  - [ ] Full width layout
  - [ ] All elements aligned

### Performance Checks
- [ ] Page load time < 3 seconds (shop page)
- [ ] Images optimized (check file sizes)
- [ ] No console warnings
- [ ] Network requests minimal
- [ ] Cache headers present (check via browser DevTools)

---

## 🚀 Upload to cPanel

### Step 1: Prepare Files
```
1. Create backup of entire emporio-sport folder
2. Verify nothing left in debug mode
3. Ensure validate_deployment.php is in root
4. Check .htaccess is included (hidden file)
```

### Step 2: Connect to cPanel
**Option A: File Manager**
1. Open cPanel
2. Files > File Manager
3. Navigate to public_html
4. Upload emporio-sport folder

**Option B: FTP**
1. Use FileZilla or similar
2. Connect to cPanel FTP credentials
3. Navigate to public_html
4. Upload emporio-sport folder

**Option C: Command Line**
```bash
# Via SSH (if available)
cd ~/public_html
scp -r emporio-sport/ user@server:/home/user/public_html/
# or
rsync -avz emporio-sport/ user@server:/home/user/public_html/
```

### Step 3: Set File Permissions
**Via File Manager:**
1. Right-click `/data` folder > Change Permissions > Set to 755
2. Right-click `/uploads` folder > Change Permissions > Set to 755
3. Right-click `/pics_ecom` folder > Change Permissions > Set to 755
4. Right-click `/sport-pics` folder > Change Permissions > Set to 755
5. Right-click `.htaccess` file > Change Permissions > Set to 644

**Via Command Line:**
```bash
# Directories: 755
chmod -R 755 emporio-sport/data/
chmod -R 755 emporio-sport/uploads/
chmod -R 755 emporio-sport/pics_ecom/
chmod -R 755 emporio-sport/sport-pics/
chmod -R 755 emporio-sport/css/
chmod -R 755 emporio-sport/js/

# Files: 644
chmod 644 emporio-sport/.htaccess
chmod 644 emporio-sport/*.php
chmod 644 emporio-sport/header.php
chmod 644 emporio-sport/footer.php
chmod 644 emporio-sport/data/*.json
```

### Step 4: Verify Upload
1. All folders present
2. All PHP files present
3. All image files present
4. `.htaccess` copied (might be hidden)

---

## ✅ Post-Upload Verification

### Immediate Tests
```
1. Visit: yourdomain.com/validate_deployment.php
2. Check all items show PASS or INFO
3. Look for any FAIL items
4. Fix any issues before proceeding
```

### Functionality Tests
```
1. Homepage: yourdomain.com/
   ✓ Loads without errors
   ✓ Logo displays
   ✓ Navigation shows
   ✓ Featured products visible
   ✓ Footer present at bottom

2. Shop: yourdomain.com/shop.php
   ✓ All products display (19+)
   ✓ Product images show
   ✓ Categories sidebar shows
   ✓ Filters work (try clicking a category)
   ✓ Pagination appears at bottom
   ✓ Footer present

3. Product Detail: yourdomain.com/product.php?id=1
   ✓ Product displays
   ✓ Image shows
   ✓ Add to cart works

4. Navigation: yourdomain.com/
   ✓ "MORE" button appears on hover
   ✓ Pages dropdown shows
   ✓ All links work
   ✓ No 404 errors

5. Mobile Test:
   ✓ Responsive on mobile (test with DevTools)
   ✓ Touch buttons minimum 44px
   ✓ Navigation accessible
```

### Error Checking
```
1. Browser Console (F12 > Console):
   ✓ No JavaScript errors
   ✓ No 404 errors for resources
   
2. Network Tab (F12 > Network):
   ✓ All images load
   ✓ All CSS loads
   ✓ All JavaScript loads
   
3. cPanel Error Log:
   cPanel > Metrics > Error Log
   ✓ No PHP errors
   ✓ No 500 errors
```

---

## 🔧 Troubleshooting Issues Found

### If validate_deployment.php Shows FAIL

**Check in this order:**

1. **File Structure FAIL**
   - Missing file in `/data/` or `/config/`
   - Solution: Re-upload missing file
   - Verify: FTP connection worked completely

2. **Image Folders FAIL**
   - `/pics_ecom/` or `/sport-pics/` missing
   - Solution: Re-upload image folders
   - Verify: Folder exists and has files

3. **JSON Files FAIL**
   - Invalid JSON syntax
   - Solution: Validate JSON at jsonlint.com
   - Fix: Correct JSON syntax and re-upload

4. **Pages Navigation FAIL**
   - pages.json empty or invalid
   - Solution: Check pages.json has proper structure
   - Verify: Visit yourdomain.com/data/pages.json

5. **Products Data FAIL**
   - products.json empty or invalid
   - Solution: Check products.json has 19+ products
   - Verify: Visit yourdomain.com/data/products.json

6. **PHP Features FAIL**
   - PHP missing required functions
   - Contact: Hosting provider
   - Issue: Likely PHP version < 7.4

### If Homepage Loads but Shop Doesn't

1. Check browser console (F12 > Console)
   - Any JavaScript errors?
   - Try refreshing with Ctrl+Shift+R (hard refresh)

2. Check network tab (F12 > Network)
   - Is products.json loading?
   - Is there a 404 error?

3. Check cPanel error log
   - Any PHP warnings or errors?
   - File permissions issue?

4. Test JSON directly
   - Visit: yourdomain.com/data/products.json
   - Should show raw JSON, not download

### If Images Don't Display

1. Check image folder permissions
   - Should be 755
   - Set via: Right-click > Change Permissions

2. Verify image filenames
   - Do files exist on server?
   - Use File Manager to browse `/pics_ecom/`

3. Check image paths in products.json
   - Should be: `"tennis.jpg"` (not full path)
   - Should be: `"sport-pics/soccer/calcio.jpg"` (for sport-pics)

4. Check browser Network tab (F12)
   - What URL is it trying to load?
   - Compare with actual file location

### If Dropdown Pages Empty

1. Verify `/data/pages.json` exists
   - Use File Manager to check
   - Download and validate JSON syntax

2. Check file permissions
   - pages.json should be readable (644)
   - /data/ folder should be 755

3. Test navigation helper
   - Add this to `/header.php` temporarily (after navigation_helper include):
   ```php
   $featured = NavigationHelper::getFeaturedPages();
   echo "<!-- DEBUG: Featured pages: " . count($featured) . " -->";
   ```
   - Reload and view source (Ctrl+U)
   - Delete debug line after testing

---

## 📋 Final Verification Checklist

Before going live, verify ALL of these:

### Homepage
- [ ] Loads instantly
- [ ] Logo displays correctly
- [ ] Navigation shows all featured pages
- [ ] "MORE" dropdown appears on hover
- [ ] Footer displays at bottom
- [ ] No 404 errors in network tab
- [ ] No JavaScript errors in console
- [ ] Mobile responsive (test with F12)

### Shop Page
- [ ] All products display (19+)
- [ ] Product images show correctly
- [ ] Categories list shows (12+)
- [ ] Each filter works:
  - [ ] Category filter
  - [ ] Price range filter
  - [ ] Rating filter (click 3 stars)
  - [ ] Brand filter (if applicable)
- [ ] Show dropdown works (select 36, 54, 72)
- [ ] Pagination shows Previous/Next buttons
- [ ] Pagination buttons work
- [ ] Footer displays at bottom

### Product Detail
- [ ] Product image displays
- [ ] Product info shows correctly
- [ ] Add to cart button visible
- [ ] Related products show (if applicable)

### Navigation
- [ ] Featured pages show in header
- [ ] "MORE" dropdown appears on hover
- [ ] Dropdown shows all non-featured pages
- [ ] All page links work (no 404)
- [ ] Links go to correct pages

### Mobile (Test with F12 Responsive Mode)
- [ ] Homepage responsive at 375px width
- [ ] Shop responsive at 375px width
- [ ] Touch buttons minimum 44x44px
- [ ] Text readable without zoom
- [ ] No horizontal scrolling
- [ ] Footer not cut off

### Performance
- [ ] Page load time < 3 seconds
- [ ] Images load quickly
- [ ] No console warnings
- [ ] CSS loads from correct paths
- [ ] JavaScript loads and runs

### Browser Compatibility
- [ ] Chrome (latest)
- [ ] Firefox (latest)
- [ ] Safari (latest)
- [ ] Edge (latest)
- [ ] Mobile Safari (iPhone)
- [ ] Chrome Mobile (Android)

---

## 🎉 Deployment Complete!

After all checks pass:

1. **Delete validation script:**
   - Remove `validate_deployment.php` from server
   - Use File Manager to delete

2. **Monitor for 24 hours:**
   - Check cPanel error log
   - Test key features hourly
   - Monitor page load times

3. **Set up monitoring:**
   - cPanel uptime monitoring
   - Error log alerts
   - Performance monitoring

4. **Create backup:**
   - cPanel > Backup
   - Regular automated backups

5. **Document:**
   - Admin password stored securely
   - Database credentials stored securely
   - Hosting account details saved

---

## 📞 Support Issues

If something fails during deployment:

1. **Gather information:**
   - Screenshot of error
   - Copy of validation results
   - Browser console errors
   - cPanel error log excerpt

2. **Check troubleshooting section above**

3. **Common fixes:**
   - Clear browser cache (Ctrl+Shift+Delete)
   - Hard refresh page (Ctrl+Shift+R)
   - Check file permissions (755/644)
   - Verify JSON files valid
   - Check cPanel error log

4. **Contact support with:**
   - Domain name
   - Specific error message
   - Steps already tried
   - Validation results

---

## 📝 Post-Launch Maintenance

### Weekly
- [ ] Check cPanel error log
- [ ] Test key pages load
- [ ] Verify images display
- [ ] Check shop filters work

### Monthly
- [ ] Backup entire site
- [ ] Update products if needed
- [ ] Review analytics
- [ ] Test admin panel

### Quarterly
- [ ] Update PHP version (if available)
- [ ] Update security patches
- [ ] Review site speed
- [ ] Check SSL certificate expiration

---

**Status: Ready for Production Deployment ✅**

**Last Updated:** January 29, 2026  
**Version:** 1.0  
**System:** Emporio Sport E-Commerce

---

**Good luck with your deployment! 🚀**
