# Installation Guide

## Quick Start

Follow these steps to set up the WP Page Tracker plugin:

### 1. Install Composer Dependencies

Open a terminal in the plugin directory and run:

```bash
composer install
```

This will install PHP-DI and other required dependencies.

### 2. Activate the Plugin

1. Go to WordPress Admin Dashboard
2. Navigate to **Plugins** → **Installed Plugins**
3. Find **WP Page Tracker**
4. Click **Activate**

### 3. Configure Settings

1. In WordPress Admin, go to **Page Tracker** in the sidebar
2. Enable page tracking by checking the "Enable Page Tracking" option
3. Click **Save Settings**

## Next Steps (Development)

The plugin skeleton is now ready. To implement the page tracking functionality:

1. **Implement tracking logic** in [src/Plugin.php](src/Plugin.php)
   - Hook into `post_updated` action
   - Hook into `transition_post_status` action

2. **Create database tables** in [src/Activation.php](src/Activation.php)
   - Uncomment the `create_tables()` call
   - Define the table schema for tracking logs

3. **Build the tracking service** in `src/Services/`
   - Create a `PageTrackerService.php` class
   - Implement change detection logic
   - Store changes in the database

4. **Add admin dashboard** in `templates/admin/`
   - Display recent changes
   - Show statistics
   - Add filters and search

5. **Implement notifications** (optional)
   - Email alerts for page changes
   - Configure recipients in settings

## File Structure

```
page-tracker/
├── page-tracker.php          # Main plugin file with metadata
├── bootstrap.php              # DI container initialization
├── composer.json              # Dependencies and autoloading
├── uninstall.php             # Cleanup on plugin deletion
├── config/
│   └── di.php                # Dependency injection config
├── src/
│   ├── Plugin.php            # Main orchestrator class
│   ├── Activation.php        # Activation hooks
│   ├── Deactivation.php      # Deactivation hooks
│   ├── Admin/
│   │   └── SettingPage.php   # Admin settings page
│   └── Helper/
│       ├── Helper.php        # Validation utilities
│       └── CurlHelper.php    # HTTP request helper
├── templates/
│   └── admin/
│       └── settings.php      # Settings page template
└── assets/
    ├── admin/
    │   ├── css/style.css
    │   └── js/script.js
    └── frontend/
        ├── css/style.css
        └── js/script.js
```

## Troubleshooting

### Composer not found
Install Composer from https://getcomposer.org/

### Autoloader not found
Run `composer install` to generate the autoloader

### Permission errors
Ensure the web server has write permissions to the plugin directory

## Support

For issues and questions, contact Exabytes support.
