# GetShouting

[![WordPress Plugin Version](https://img.shields.io/badge/WordPress-5.8+-blue.svg)](https://wordpress.org/)
[![WooCommerce Version](https://img.shields.io/badge/WooCommerce-5.0+-purple.svg)](https://woocommerce.com/)
[![License](https://img.shields.io/badge/License-GPLv3-green.svg)](https://www.gnu.org/licenses/gpl-3.0.html)

Official WordPress plugin for connecting WooCommerce stores to [Get Shouting](https://www.getshouting.app) - the social media marketing automation platform for e-commerce.

## Features

- ✅ **One-Click Connection** - No manual API key generation needed
- ✅ **Automatic Product Sync** - Real-time synchronization via webhooks
- ✅ **Order Tracking** - Performance analytics for your products
- ✅ **Inventory Alerts** - Low stock and slow-moving product notifications
- ✅ **Secure** - Enterprise-grade encryption (AES-256-GCM)
- ✅ **GDPR Compliant** - No customer personal data transmitted

## Requirements

- WordPress 5.8 or higher
- WooCommerce 5.0 or higher
- PHP 7.4 or higher
- HTTPS enabled (SSL certificate)
- Pretty permalinks enabled

## Installation

### From WordPress.org (Recommended)

1. Log in to your WordPress admin
2. Go to **Plugins → Add New**
3. Search for "GetShouting"
4. Click **Install Now** → **Activate**
5. Go to **WooCommerce → Get Shouting**
6. Click **"Connect to Get Shouting"**

### Manual Installation

1. Download the latest release
2. Upload to `/wp-content/plugins/getshouting/`
3. Activate the plugin in WordPress admin
4. Go to **WooCommerce → Get Shouting**
5. Click **"Connect to Get Shouting"**

## Usage

### Connecting Your Store

1. Navigate to **WooCommerce → Get Shouting** in your WordPress admin
2. Click the **"Connect to Get Shouting"** button
3. You'll be redirected to Get Shouting
4. Log in or create your account
5. Select which brand to connect to this store
6. You'll be redirected back to WordPress
7. ✅ Connected! Your products will start syncing automatically

### Managing Connection

- **View Status**: WooCommerce → Get Shouting
- **Refresh Status**: Click "Refresh Status" button
- **Disconnect**: Click "Disconnect" button (optional: delete API keys)

## Development

### Setup Development Environment

```bash
# Clone repository
git clone https://github.com/whatnologist/getshouting_wordpress_plugin.git
cd getshouting_wordpress_plugin

# Install dependencies
composer install
npm install

# Run coding standards check
composer phpcs

# Run tests
composer test
```

### File Structure

```
getshouting/
├── getshouting.php                  # Main plugin file
├── includes/
│   ├── class-getshouting-connector.php
│   ├── class-api-key-manager.php
│   └── class-connection-handler.php
├── admin/
│   ├── views/connection-dashboard.php
│   ├── css/admin-styles.css
│   └── js/admin-scripts.js
├── readme.txt                      # WordPress.org readme
└── README.md                       # GitHub readme
```

## Integration Details

This plugin integrates with Get Shouting's WooCommerce API:

- **Connect Endpoint**: `POST /api/integrations/woocommerce/connect`
- **Disconnect Endpoint**: `POST /api/integrations/woocommerce/disconnect`
- **Webhook Endpoint**: `POST /api/integrations/woocommerce/webhook`

### Data Synced

**Products**:
- Product ID, SKU, title, description
- Price, compare-at price, currency
- Inventory quantity and stock status
- Images and primary image URL
- Categories and tags
- Product variations

**Orders** (for analytics only):
- Order ID and line items
- Product IDs and quantities sold
- Revenue per product
- **No customer personal data**

## Security

- ✅ API keys auto-generated with WooCommerce native functionality
- ✅ Credentials encrypted with AES-256-GCM before storage
- ✅ HTTPS required for all API communication
- ✅ Webhook HMAC-SHA256 signature verification
- ✅ WordPress nonces for all AJAX requests
- ✅ Input sanitization and output escaping
- ✅ Follows WordPress and WooCommerce security best practices

## Privacy & GDPR Compliance

- ✅ Only syncs product and order data (no customer PII)
- ✅ Data deletion on disconnect (optional)
- ✅ Clear privacy policy disclosures
- ✅ User consent via connection flow
- ✅ Audit logging for all connections/disconnections

## Support

- **Plugin Support**: [WordPress.org Support Forum](https://wordpress.org/support/plugin/getshouting/)
- **Get Shouting Help**: [Get Shouting Help Center](https://www.getshouting.app/help)
- **Report Issues**: [GitHub Issues](https://github.com/whatnologist/getshouting_wordpress_plugin/issues)

## Contributing

We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## License

This plugin is licensed under the GNU General Public License v3.0 or later.
See [LICENSE](LICENSE) for full license text.

## Credits

Developed by the [Get Shouting](https://www.getshouting.app) team.

## Changelog

### 1.0.0 - 2025-11-27
- Initial release
- One-click connection flow
- Automatic API key generation
- Real-time product synchronization
- Order tracking integration
- Webhook support
- GDPR compliance

