# Botless Plugin Suite - Core Architecture

This directory contains shared base classes and functionality for the Botless plugin suite.

## Plugin Suite Structure

The Botless suite consists of multiple plugins that share common functionality:

- **Botless Video** (`botless-core`) - Protects video content from bots
- **Botless Images** (`botless-images`) - Protects image content from bots  
- **Botless Audio** (`botless-audio`) - Protects audio content from bots
- **Botless Files** (`botless-files`) - Protects file downloads from bots
- **Botless Custom** (`botless-custom`) - Custom content protection

## Text Domain Strategy

Each plugin uses its own text domain to comply with WordPress.org requirements:

- `botless-core` for Botless Video
- `botless-images` for Botless Images
- `botless-audio` for Botless Audio
- `botless-files` for Botless Files
- `botless-custom` for Botless Custom

The base classes dynamically determine which text domain to use based on the `resource_type` property.

## Shared Components

### Base Classes

- `BasePlugin` - Common plugin initialization and functionality
- `BaseSettings` - Shared settings management
- `BaseLogger` - Common logging functionality

### Shared Functions

- `constants.php` - Shared constants and helper functions for the plugin suite
- `functions.php` - Utility functions used across all plugins

## Usage in New Plugins

When creating a new Botless plugin:

1. Copy the `includes/core/` directory to your new plugin
2. Include `constants.php` in your main plugin file
3. Extend the base classes and set the appropriate `resource_type`
4. The text domain will be automatically determined

Example for Botless Images:

```php
class Botless_Images_Settings extends \Botless\Core\BaseSettings {
    protected function get_resource_type() {
        return 'image'; // Will use 'botless-images' text domain
    }
}
```

## WordPress.org Compliance

This architecture satisfies WordPress.org requirements:
- Each plugin uses its own text domain matching its slug
- No hardcoded shared text domains
- Proper sanitization and escaping
- Follows WordPress coding standards

## Future Enhancements

- Shared admin menu management
- Cross-plugin analytics
- Unified settings export/import
- Plugin suite activation/deactivation handling 