# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## ⚠️ Project Status: Archived/Deprecated

**This project is old and effectively archived.** It remains available at https://wordpress.org/plugins/developer-loggers-for-simple-history/ with approximately 300 active installations.

**Maintenance policy**: Only security-related issues will be addressed. No new features or non-security bug fixes will be implemented.

## Project Overview

This is a WordPress plugin that extends Simple History with additional developer-focused loggers. The plugin follows an SVN repository structure with trunk/ for main development and tags/ for releases.

## Architecture

The plugin uses a modular logger architecture:
- **Main Plugin File**: `trunk/developer_loggers.php` - Entry point that registers the plugin with WordPress
- **Core Class**: `trunk/class.php` - `SimpleHistory_DeveloperLoggers` class that manages logger registration, settings, and initialization
- **Individual Loggers**: `trunk/loggers/*.php` - Each file contains a logger class extending `SimpleLogger`

Each logger:
1. Extends the `SimpleLogger` base class from Simple History
2. Implements `getInfo()` to provide metadata
3. Implements `loaded()` to hook into WordPress events
4. Uses Simple History's logging methods to record events

## Commands

### Testing
```bash
# Run PHPUnit tests (requires WordPress test environment)
cd trunk
phpunit

# Install WordPress test environment (first time setup)
bash bin/install-wp-tests.sh <db-name> <db-user> <db-pass> [db-host] [wp-version]
```

### Development
```bash
# The plugin doesn't use npm/composer, so no build step is required
# To test the plugin, install it in a WordPress environment with Simple History plugin active
```

## Key Implementation Patterns

1. **Logger Registration**: Loggers are auto-loaded from `trunk/loggers/` directory based on enabled settings
2. **Settings Management**: Plugin provides a settings tab in Simple History where admins can enable/disable individual loggers
3. **Logger Naming**: Logger class names match their filenames (e.g., `WPMailLogger` in `WPMailLogger.php`)
4. **Dependency**: Requires Simple History plugin to be installed and activated, PHP 5.4+

## Available Loggers

Located in `trunk/loggers/`:
- `WPMailLogger` - Logs emails sent via wp_mail()
- `FourOhFourLogger` - Logs 404 errors
- `JSErrorLogger` - Logs JavaScript errors
- `SystemLog_Logger` - System log events
- `ErrorLog_Logger` - PHP error logging
- `HTTP_Logger` - Logs HTTP API calls
- `WPCron` - WordPress cron events
- `BackUpWordPress_pluginlogger` - BackUpWordPress plugin events
- Additional experimental loggers in development