# SecuSeek WordPress Plugin

A WordPress plugin that integrates SecuSeek's external security scan services into your WordPress admin panel.

## Features

- 🔍 **Security Scanning**: Automated security vulnerability scanning
- 📊 **Findings Dashboard**: View and manage security findings with filtering
- 🔐 **API Integration**: Secure API key management with encryption
- 🎨 **Modern UI**: Alpine.js powered responsive interface
- ⚡ **Real-time Updates**: Live scan progress monitoring

## Installation

1. Upload the plugin files to `/wp-content/plugins/secuseek/`
2. Activate the plugin through WordPress admin
3. Enter your SecuSeek API key in the plugin settings

## Development

### Prerequisites

- WordPress 5.0+
- PHP 7.4+
- Modern web browser with JavaScript support

### File Structure

```
secuseek/
├── assets/
│   ├── css/           # Stylesheets
│   ├── js/            # JavaScript files
│   └── img/           # Images and icons
├── includes/          # PHP classes and functions
├── templates/         # Template files
├── languages/         # Translation files
├── secuseek.php      # Main plugin file
├── uninstall.php     # Uninstall handler
└── readme.txt        # WordPress.org readme
```

### Minified Files and Source Code

This plugin includes the following minified files with their corresponding source code:

**Alpine.js (alpinejs.min.js)**
- Source: https://github.com/alpinejs/alpine
- Version: 3.13.10
- License: MIT
- The minified version is included for performance, but the full source code is available at the GitHub repository above.
- Build process: The minified file is downloaded from the official Alpine.js CDN and included directly.

**Font Awesome (fontawesome.min.css)**
- Source: https://github.com/FortAwesome/Font-Awesome
- Version: 6.5.0
- License: Font Awesome Free License
- The minified version is included for performance, but the full source code is available at the GitHub repository above.
- Build process: The minified file is downloaded from the official Font Awesome CDN and included directly.

**Note:** All minified files are third-party libraries. The plugin's own JavaScript and CSS files are not minified and are included in their readable form in the assets directory.

### Build Process

The plugin uses standard WordPress enqueue methods. No build tools are required as all JavaScript and CSS files are included directly in their readable form. The minified files are third-party libraries included for performance optimization.

### Naming Convention

This plugin follows WordPress.org naming guidelines to prevent conflicts with other plugins:
- All functions, classes, and global variables use the `secuseek_` prefix
- Class names are descriptive and unique (e.g., `Secuseek_Fetcher_Service`)
- Global variables are namespaced (e.g., `$GLOBALS['secuseek_findings_data']`)
- No generic names like `Fetcher`, `$findings`, or `$template` are used

### Security

This plugin implements WordPress.org security best practices:
- All PHP files include `ABSPATH` checks to prevent direct file access
- Template files are protected from unauthorized execution
- Includes proper nonce verification and capability checks
- Sanitizes all user inputs and escapes all outputs
- API keys are encrypted using AES-256-CBC encryption

### API Integration

The plugin integrates with SecuSeek's external API:
- **Base URL**: `https://api.secuseek.com`
- **Authentication**: API key via `x-api-key` header
- **Endpoints**:
  - `GET /api/v1/external/schedule-scan` - Validate API-Key
  - `POST /api/v1/external/schedule-scan` - Create scan
  - `GET /api/v1/external/schedule-scan/{id}` - Get scan status
  - `GET /api/v1/external/issues/{id}` - Get scan results
  - `DELETE /api/v1/external/schedule-scan/{id}` - Delete scan

### Frontend Architecture

- **Alpine.js**: Reactive UI framework
- **Vanilla JavaScript**: Custom functionality
- **CSS3**: Modern styling with responsive design
- **Font Awesome**: Icon library

### Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Test thoroughly
5. Submit a pull request

### License

GPLv2 or later - https://www.gnu.org/licenses/gpl-2.0.html

### Support

For support and questions, please contact the plugin author or visit the SecuSeek documentation.