# Method Documentation Template for WooCommerce Plugin

Use this template to document all remaining methods in the plugin files:

```php
/**
 * [Brief description of what the method does - 1 line]
 * [More detailed explanation of functionality, parameters, and return values - 1-2 lines]
 * Called by: [Specific caller - WordPress hook name, class name, or method name]
 */
public function method_name() {
```

## Documentation Pattern Examples:

### Constructor Methods:
```php
/**
 * Initialize [class purpose] and register WordPress hooks
 * Sets up [specific functionality] and [other setup tasks]
 * Called by: WordPress when class is instantiated
 */
public function __construct() {
```

### WordPress Hook Methods:
```php
/**
 * [Action description] for [business purpose]
 * [Details about what data is processed and why]
 * Called by: WordPress [hook_name] hook
 */
public function method_name() {
```

### API/External Methods:
```php
/**
 * [Action] with [external service] using [authentication method]
 * [Purpose and data handling details]
 * Called by: [Calling class/method] when [trigger condition]
 */
public function method_name() {
```

### Utility/Helper Methods:
```php
/**
 * [Action] for [specific purpose]
 * [Processing details and return information]
 * Called by: [Methods that use this utility]
 */
private function method_name() {
```

## Files Still Needing Documentation:

### High Priority (Business Critical):
1. `inc/oauth-handler.php` - Complete remaining OAuth methods
2. `inc/class-messengeros-api-client.php` - Main API communication
3. `inc/admin-forms.php` - Complete remaining form methods
4. `inc/admin-product-sync.php` - Product synchronization
5. `inc/woocommerce-integration.php` - WooCommerce hooks

### Medium Priority:
6. `inc/class-product-tracker.php` - Product tracking functionality
7. `inc/oauth-auto-register.php` - Auto-registration methods
8. `inc/initial-sync-handler.php` - Initial sync logic
9. `inc/product-sync.php` - Product sync operations

### Lower Priority (Utilities):
10. `inc/helpers.php` - Helper functions
11. `inc/class-store-identifier.php` - Store identification
12. `inc/class-event-hooks.php` - Event hook management

## Key Documentation Principles:

1. **Business Purpose First**: Explain WHY the method exists
2. **Caller Information**: Always specify who/what calls this method
3. **WordPress Context**: Include hook names, action types, etc.
4. **Security Context**: Note authentication, validation, sanitization
5. **Integration Points**: Mention external APIs, services, databases

## Common Callers to Include:

- WordPress hooks: `admin_menu`, `admin_init`, `wp_enqueue_scripts`, etc.
- WooCommerce hooks: `woocommerce_add_to_cart`, `woocommerce_thankyou`, etc.
- Plugin classes: `MessengerOS_OAuth_Handler`, `MessengerOS_API_Client`, etc.
- AJAX handlers: `wp_ajax_*` actions
- Shortcode system: `[messos-newsletter-form]`
- Cron/scheduled events: `wp_schedule_event`

## Skip These Method Types:

- Simple getters/setters (unless they have business logic)
- Basic property access methods
- Simple validation methods without complex logic

Use this template to maintain consistency across all plugin documentation.