# Crawl Hunt WordPress Plugin

A powerful website crawler and monitoring tool for WordPress, built with React and WordPress's built-in React (`wp-element`).

## Features

- 🚀 Built with React using WordPress's `@wordpress/element`
- 📊 Real-time crawl activity dashboard
- ⚙️ Easy-to-use settings interface
- 🔌 REST API for external crawler integration
- 🎨 Modern, responsive UI with WordPress components
- 🔒 API key authentication for secure access

## Development

### Prerequisites

- Node.js 16+ and npm
- WordPress 5.0+
- PHP 7.4+

### Setup

1. **Install dependencies:**
   ```bash
   npm install
   ```

2. **Development mode (with hot reload):**
   ```bash
   npm start
   ```

3. **Build for production:**
   ```bash
   npm run build
   ```

### Project Structure

```
crawl-hunt/
├── src/
│   ├── admin/              # Dashboard React app
│   │   ├── components/
│   │   │   └── Dashboard.js
│   │   ├── index.js
│   │   └── style.scss
│   └── settings/           # Settings React app
│       ├── components/
│       │   └── Settings.js
│       ├── index.js
│       └── style.scss
├── build/                  # Compiled assets (auto-generated)
├── crawl-hunt.php         # Main plugin file
├── package.json
└── webpack.config.js
```

## Usage

### Activation

1. Activate the plugin through the WordPress plugins screen
2. Access "Crawl Hunt" from the admin menu
3. Configure your settings and API key

### REST API Endpoints

#### Log a crawl
```http
POST /wp-json/crawl-hunt/v1/log
Content-Type: application/json
X-API-Key: your-api-key

{
  "url": "https://example.com/page",
  "status": "success"
}
```

#### Get logs (requires admin authentication)
```http
GET /wp-json/crawl-hunt/v1/logs
```

#### Get/Save settings (requires admin authentication)
```http
GET /wp-json/crawl-hunt/v1/settings
POST /wp-json/crawl-hunt/v1/settings
```

## Technologies

- **React**: Via WordPress's `@wordpress/element`
- **WordPress Components**: `@wordpress/components` for UI
- **WordPress Scripts**: `@wordpress/scripts` for build tooling
- **REST API**: WordPress REST API
- **SCSS**: For styling

## License

GPL v2 or later
