# Seasonal Popup Plugin

A WordPress plugin for creating animated seasonal popups with customizable triggers, animations, and styling.

## Features

### Content & Appearance
- **Seasonal Icons**: Choose from 30+ seasonal icons (snowflakes, hearts, pumpkins, flowers, etc.)
- **Animated Icons**: 5 different animation styles
  - **Falling**: Icons fall from top with wobble effect (inspired by your heart game)
  - **Fade In**: Smooth fade-in animation
  - **Slide from Left**: Slides in from the left side
  - **Slide from Right**: Slides in from the right side
  - **Scale Up**: Grows from small to large
  
- **Customizable Content**:
  - Headline and body text
  - Background image
  - Call-to-action button with custom URL
  - Optional email input field
  - Full color customization (background, text, button)

### Trigger Options
- **Page Load**: Show popup immediately when page loads
- **Exit Intent**: Show when visitor moves cursor outside viewport
- **After Delay**: Show after specified seconds

### Visitor Tracking
- **Max Views Per Visitor**: Control how many times each visitor sees the popup (default: 1)
- Visitor identification via IP + User Agent hash
- Database tracking of popup views

### Display Options
- **Show on All Pages**: Display on every page of your site
- **Show on Specific Pages**: Display only on selected page IDs

## Installation

1. Upload the `seasonal-popup` folder to `/wp-content/plugins/`
2. Activate the plugin from WordPress admin
3. Go to Dashboard → Seasonal Popup to configure

## Usage

### Basic Setup

1. Navigate to **Dashboard → Seasonal Popup**
2. Check "Enable Popup"
3. Configure your popup content:
   - Enter headline and text
   - Upload an optional background image
   - Set button text and URL
4. Choose a seasonal icon from the dropdown
5. Select an animation style
6. Set colors for background, text, and button
7. Choose a trigger type
8. Set maximum views per visitor
9. Choose which pages to show on
10. Click Save

### Seasonal Icons Available

**Winter**: Snowflake, Snowman, Christmas Tree, Santa, Gift, Candy Cane
**Spring**: Flower, Cherry Blossom, Tulip, Bee, Butterfly, Rainbow, Easter Egg
**Summer**: Sun, Ice Cream, Watermelon, Surfboard, Beach Ball, Fireworks, Confetti
**Fall**: Fall Leaf, Pumpkin, Ghost, Candy, Apple
**General**: Heart, Pink Heart, Star, Sparkles

### Animation Details

- **Falling**: Perfect for seasonal themes, mimics natural falling motion with wobble
- **Fade In**: Subtle and professional, good for all use cases
- **Slide animations**: Dynamic and attention-grabbing
- **Scale Up**: Playful and modern

## Technical Details

### Database
- Creates a table to track visitor views: `wp_seasonal_popup_views`
- Stores visitor hash, popup ID, view count, and timestamps
- **Completely deleted on plugin uninstallation** (not just deactivation)

### Visitor Identification
- Uses IP address + User Agent to create unique hash
- Allows per-visitor view limit tracking
- No personal data is stored

### Customization
All CSS can be overridden by adding custom styles to your theme:

```css
.seasonal-popup-container {
    /* Your custom styles */
}

.seasonal-popup-icon {
    /* Your custom styles */
}
```

## Uninstallation

Simply deactivate and delete the plugin from your WordPress admin panel. All plugin options and database tables will be automatically removed.

## Frequently Asked Questions

**Q: Will this slow down my site?**
A: No. The plugin loads minimal JavaScript and CSS only on the frontend.

**Q: Can I track conversions?**
A: The plugin tracks views. Email clicks can be tracked through Google Analytics or other tracking tools.

**Q: Can I have multiple popups?**
A: Currently, this version supports one popup. Future versions may add multiple popup support.

**Q: How is the visitor identified?**
A: Using a hash of IP address and user agent. This is non-invasive and doesn't require cookies.

**Q: Can I customize animations further?**
A: Yes, you can override the CSS animations in your theme's custom CSS.

## Support

For issues or feature requests, please visit [JustLingo.com](https://justlingo.com).

## License

This plugin is licensed under GPL2. See LICENSE file for details.
