# Troubleshooting Guide

Having issues with BuddyPress Check-ins? This guide will help you solve common problems.

---

## Quick Fixes

Before diving into specific issues, try these common solutions:

1. **Clear your browser cache** - Outdated cached files can cause display issues
2. **Deactivate and reactivate the plugin** - This can reset temporary issues
3. **Check for plugin updates** - Make sure you're using the latest version
4. **Test in another browser** - This helps identify browser-specific issues

---

## Location Search Issues

### Problem: Location suggestions don't appear when I type

**Possible causes and solutions:**

#### 1. Invalid Google API Key

**How to check:**
1. Go to **Wbcom > BuddyPress Check-ins**
2. Click the **Verify** button next to your API key
3. If verification fails, your key may be invalid

**Solution:**
- Double-check the API key for typos
- Generate a new key if needed
- Make sure you copied the entire key

#### 2. Required APIs not enabled

**How to fix:**
1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Select your project
3. Go to **APIs & Services > Library**
4. Enable these APIs:
   - Maps JavaScript API
   - Places API
   - Geocoding API

#### 3. API Key restrictions blocking your domain

**How to fix:**
1. In Google Cloud Console, go to **Credentials**
2. Click on your API key
3. Under "Application restrictions":
   - Select "HTTP referrers (websites)"
   - Add your website URL (e.g., `https://yoursite.com/*`)
4. Save changes

#### 4. Billing not enabled on Google Cloud

**How to fix:**
1. Go to [Google Cloud Console Billing](https://console.cloud.google.com/billing)
2. Set up a billing account
3. Link it to your project

**Note:** Google offers free monthly credits that cover most small-site usage.

---

### Problem: "Google Maps API error" appears in browser console

**Common error messages and fixes:**

| Error | Solution |
|-------|----------|
| `ApiNotActivatedMapError` | Enable Maps JavaScript API in Google Cloud Console |
| `RefererNotAllowedMapError` | Add your domain to the API key's allowed referrers |
| `MissingKeyMapError` | Add your API key in the plugin settings |
| `InvalidKeyMapError` | Check your API key for typos or generate a new one |
| `OverQuotaMapError` | You've exceeded the free tier; check your billing |

---

## Display Issues

### Problem: The location icon doesn't appear

**Possible causes:**

1. **Not logged in** - You must be logged in to use check-ins
2. **Theme conflict** - Your theme might be hiding the icon
3. **Plugin conflict** - Another plugin might be interfering
4. **JavaScript error** - Check browser console for errors

**How to fix:**

1. Make sure you're logged in
2. Try switching to a default BuddyPress theme temporarily
3. Deactivate other plugins one by one to find conflicts
4. Check browser console (F12) for JavaScript errors

### Problem: The Check-ins tab doesn't show on profiles

**Check these settings:**

1. Go to **Wbcom > BuddyPress Check-ins**
2. Make sure "Enable Check-ins Tab" is checked
3. Save settings

**Still not showing?**
- Clear your browser cache
- Check if your theme is hiding profile tabs
- Try with a default theme to test

### Problem: Maps don't display correctly

**Try these solutions:**

1. **Check API key** - Verify your Google API key is valid
2. **Clear cache** - Clear browser and any caching plugin cache
3. **Check console** - Look for errors in browser developer tools
4. **Test on another page** - See if maps work elsewhere on your site

---

## Performance Issues

### Problem: Pages load slowly after adding check-ins

**Possible causes:**

1. **Too many Google Maps API calls**
2. **Cache not configured**
3. **Too many check-ins loading at once**

**Solutions:**

1. Use a caching plugin (WP Super Cache, W3 Total Cache, etc.)
2. Enable lazy loading in your theme
3. Limit the number of activities displayed per page

### Problem: Check-in saving is slow

**Try these:**

1. Check your server response time
2. Make sure your database is optimized
3. Reduce the number of plugins running on activity post

---

## Data Issues

### Problem: Check-in locations are not saving

**Troubleshooting steps:**

1. **Check for JavaScript errors**
   - Open browser console (F12)
   - Look for red error messages
   - Fix any JavaScript conflicts

2. **Verify form submission**
   - Check if the location data is being submitted
   - Look for AJAX errors in the network tab

3. **Check database permissions**
   - Your WordPress database user needs INSERT/UPDATE permissions

4. **Test with default theme and plugins disabled**
   - This identifies conflicts

### Problem: Old check-ins disappeared

**Check these:**

1. **Activity post deleted** - If you delete an activity, the check-in goes with it
2. **Database issue** - Check if the `bp_activity_meta` table has the data
3. **Plugin deactivation** - Data remains but isn't displayed when plugin is inactive

---

## API Quota Issues

### Problem: "You have exceeded your request quota" error

**What's happening:**
You've exceeded Google's free tier limits.

**Solutions:**

1. **Check your usage**
   - Go to Google Cloud Console
   - Navigate to APIs & Services > Dashboard
   - View your API usage statistics

2. **Optimize API calls**
   - Use browser caching
   - Limit the number of maps loaded per page
   - Use a WordPress caching plugin

3. **Upgrade your Google Cloud plan**
   - If you need more, you'll need to pay for additional usage

---

## Browser-Specific Issues

### Problem: Check-ins work in Chrome but not Safari/Firefox

**Try these:**

1. **Clear browser cache and cookies**
2. **Disable browser extensions** - Ad blockers can interfere
3. **Check browser console** for specific errors
4. **Update your browser** to the latest version

### Problem: Mobile browsers have issues

**Solutions:**

1. **Test on different mobile browsers**
2. **Check responsive design** - Your theme might have mobile issues
3. **Allow location permissions** if prompted
4. **Use HTTPS** - Some mobile browsers require secure connections for location

---

## BuddyBoss Specific Issues

### Problem: Check-ins not working with BuddyBoss

**Check these:**

1. **BuddyBoss version compatibility**
   - Make sure you're using a compatible version
   - Check the plugin's compatibility information

2. **BuddyBoss activity form**
   - BuddyBoss uses a different activity form
   - The plugin should detect and adapt

3. **Theme compatibility**
   - Try with default BuddyBoss theme
   - Check for theme-specific conflicts

---

## Getting More Help

### Before contacting support:

1. **Gather information:**
   - WordPress version
   - BuddyPress/BuddyBoss version
   - Plugin version
   - Theme name and version
   - Error messages (copy exact text)
   - Screenshot of the issue

2. **Document what you've tried:**
   - List the troubleshooting steps you've attempted
   - Note what worked and what didn't

### Contact Support

- **Website:** [wbcomdesigns.com/contact](https://wbcomdesigns.com/contact)
- **Include:** All the information gathered above

---

## Debug Mode

For advanced troubleshooting, enable WordPress debug mode:

1. Edit `wp-config.php`
2. Add these lines:
   ```php
   define( 'WP_DEBUG', true );
   define( 'WP_DEBUG_LOG', true );
   ```
3. Check `wp-content/debug.log` for errors
4. **Remember to disable debug mode on live sites**

---

## Related Resources

- [Getting Started Guide](./getting-started.md)
- [Settings Guide](./settings-guide.md)
- [FAQ](./faq.md)
