63 lines
2.1 KiB
Markdown
63 lines
2.1 KiB
Markdown
# CLAUDE.md
|
|
|
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
|
## Project Overview
|
|
|
|
This is a WordPress plugin for integrating Twilio functionality. The plugin is in early development stage.
|
|
|
|
## WordPress Plugin Development Structure
|
|
|
|
When developing this plugin, follow WordPress plugin conventions:
|
|
- Main plugin file should be in the root directory (e.g., `twilio-wp-plugin.php`)
|
|
- Use `includes/` directory for PHP class files and core functionality
|
|
- Use `admin/` directory for admin-specific functionality
|
|
- Use `public/` directory for frontend functionality
|
|
- Use `assets/` directory for CSS, JS, and image files
|
|
|
|
## Development Commands
|
|
|
|
Since this is a WordPress plugin, typical commands include:
|
|
|
|
```bash
|
|
# Install WordPress development dependencies (if using Composer)
|
|
composer install
|
|
|
|
# Install JavaScript dependencies (if using npm)
|
|
npm install
|
|
|
|
# Build assets (if using build tools)
|
|
npm run build
|
|
|
|
# Run PHP CodeSniffer for WordPress coding standards
|
|
vendor/bin/phpcs
|
|
|
|
# Fix PHP coding standards automatically
|
|
vendor/bin/phpcbf
|
|
|
|
# Run PHPUnit tests
|
|
vendor/bin/phpunit
|
|
```
|
|
|
|
## Key WordPress Plugin Conventions
|
|
|
|
- Use WordPress hooks and filters system for extending functionality
|
|
- Follow WordPress coding standards for PHP, JavaScript, and CSS
|
|
- Prefix all functions, classes, and global variables with plugin-specific prefix to avoid conflicts
|
|
- Use WordPress's built-in functions for database operations, HTTP requests, and sanitization
|
|
- Store Twilio API credentials using WordPress options API with encryption
|
|
|
|
## Twilio Integration Points
|
|
|
|
When working with Twilio API:
|
|
- Store API credentials securely in WordPress options
|
|
- Use WordPress's `wp_remote_post()` and `wp_remote_get()` for API calls
|
|
- Implement proper error handling and logging using WordPress error logging
|
|
- Consider rate limiting and webhook verification for security
|
|
|
|
## Testing Approach
|
|
|
|
- Use PHPUnit for unit testing PHP code
|
|
- Mock WordPress functions using Brain Monkey or WP_Mock
|
|
- Test Twilio API interactions using mock responses
|
|
- Use WordPress testing framework for integration tests |