# CLAUDE.md

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

## Project Overview

PublishPress Checklists Pro is a WordPress plugin that extends the free PublishPress Checklists plugin with Pro features. The free plugin is bundled via Composer in `lib/vendor/publishpress/publishpress-checklists/` - never modify it directly.

## Commands

### Setup & Dependencies
```bash
composer install                  # Install dependencies (also runs in lib/)
composer update                   # Update dependencies
```

### Building
```bash
phing set-version                 # Update version number across files
phing build                       # Build plugin package
composer build                    # Alternative build via pbuild
composer build:clean              # Clean build artifacts
```

### Testing & Linting
```bash
composer test                     # Run unit tests (Codeception)
./vendor/bin/phplint              # Check PHP syntax errors
```

### Translations
```bash
composer make-pot                 # Generate POT template
composer make-mo                  # Generate MO files from PO files
composer translate                # Full translation workflow
```

### Dependency Management
```bash
composer check:deps               # Check dependency versions vs free plugin
composer fix:deps                 # Fix dependency merges
```

## Architecture

### Entry Point
`publishpress-checklists-pro.php` - Main plugin file that:
- Loads the bundled free plugin from `lib/vendor/publishpress/publishpress-checklists/`
- Registers namespaces via the Checklists Autoloader
- Initializes the DI container (WPPF framework with Pimple)

### Directory Structure
- `src/` - Pro plugin source code
  - `modules/` - Feature modules (woocommerce, acf, rank-math, accessibility, etc.)
  - `duplicate-checklist/` - Duplicate checklist feature
  - `status-filter/` - Status filtering feature
  - `PluginServiceProvider.php` - DI container configuration
  - `PluginInitializer.php` - Plugin initialization and module loading
  - `HooksAbstract.php` - Hook constants
- `lib/` - Dependencies
  - `vendor/` - Composer dependencies
  - `wppf/` - WordPress Plugin Framework
- `tests/` - Codeception test suite

### Module Pattern
Each module in `src/modules/{module-name}/` follows:
```
module-name/
├── module-name.php         # Main module file
├── assets/                 # CSS/JS assets
└── lib/
    └── Requirement/        # Requirement checker classes
```

### Dependency Injection
```php
// Services registered in PluginServiceProvider
$container = new DIContainer();
$container->register(new PluginServiceProvider());

// Access services
$service = $container->get(ServicesAbstract::PLUGIN_INITIALIZER);
```

### Hooks System
Hook constants defined in `HooksAbstract`:
- `publishpress_checklists_module_dirs` - Filter to register module directories
- `publishpress_checklists_load_addons` - Action to load addons
- `publishpress_checklists_requirement_list` - Filter requirement list

## Key Constants
- `PPCHPRO_VERSION` - Plugin version
- `PPCHPRO_PLUGIN_DIR_PATH` - Plugin directory path
- `PPCHPRO_LIB_VENDOR_PATH` - Lib vendor path
- `PPCHPRO_ITEM_ID` - EDD product ID (6465)

## Adding New Modules
1. Create directory in `src/modules/{module-name}/`
2. Register namespace in main plugin file's `add_action('plugins_loaded', ...)` callback
3. Module is loaded via `PluginInitializer::filterModulesDirs()`

## Branch Strategy
- Main branch: `development`
- Always create PRs targeting `development`, never `master`
- Branch naming: `fix/#issue-description` or `feature/description`

## Code Style
- PSR-12 PHP coding standard
- PHP 7.2.5+ compatibility required
- WordPress 5.5+ required
- Text domain: `publishpress-checklists-pro`
