# Floating Circle Button - Project Map

## Overview
**Plugin Name**: Floating Circle Button  
**Version**: 1.1.0  
**Author**: iDevelop  
**WordPress.org**: https://wordpress.org/plugins/idevelop-floating-circle-button/

A premium multi-channel floating contact hub with WhatsApp, Email, Phone, Telegram support.

---

## File Structure

| File | Purpose |
|------|---------|
| `idevelop-floating-circle-button.php` | Main plugin file (919 lines) - all PHP logic |
| `idevelop-floating-circle-button.css` | Frontend styles |
| `idevelop-floating-circle-button.js` | Frontend JavaScript |
| `readme.txt` | WordPress.org readme |
| `release.sh` | Release automation script |

---

## Main Features (v1.1.0)

### 1. Social Hub (Multi-Channel)
- Add multiple contact options
- Fanning animation reveals all channels
- Supported: WhatsApp, Email, Phone, Telegram, Custom Link

### 2. Office Hours
- Weekly schedule configuration
- Button auto-hides outside working hours

### 3. Smart Nudge
- Animated speech bubble
- Customizable delay and text

### 4. GDPR Analytics
- Opt-in click tracking
- No personal data stored

---

## Key Class: `iDevelop_Floating_Button`

### Admin Methods
- `add_admin_menu()` - Settings page in admin
- `settings_init()` - Register all settings fields
- `settings_page_html()` - Render settings UI
- `sanitize_floating_button_options()` - Validate input

### Frontend Methods
- `display_floating_button()` - Render button HTML
- `enqueue_styles()` - Load CSS/JS
- `is_within_office_hours()` - Check schedule
- `render_channel_button()` - Render individual channel

### AJAX Handlers
- `handle_click_tracking()` - Track clicks for analytics

---

## Settings Structure

All settings stored in: `idevelop_floating_button_options`

```php
[
    'enable' => 1,
    'phone' => '+972...',
    'pre_filled_message' => 'Hello {{title}}',
    'icon' => 'icon1',
    'vertical_position' => 'bottom',
    'horizontal_position' => 'right',
    'display_devices' => ['desktop', 'mobile', 'tablet'],
    'delay' => 0,
    'scroll_percentage' => 0,
    'open_new_tab' => 1,
    'channels' => [...],
    'hours_enabled' => 0,
    'schedule' => [...],
    'nudge_enabled' => 0,
    'nudge_text' => '',
    'nudge_delay' => 5,
    'analytics_enabled' => 0
]
```

---

## WordPress.org Assets

Located in `.wordpress-org/`:
- `banner-772x250.png` - Plugin banner
- `banner-1544x500.png` - Retina banner
- `icon-128x128.png` - Plugin icon
- `icon-256x256.png` - Retina icon
