--- phase: 01-foundation-setup plan: 01 type: execute depends_on: [] files_modified: [ddhh-job-manager.php, includes/class-ddhh-job-manager.php, includes/class-activator.php, includes/class-deactivator.php] --- Create WordPress plugin boilerplate with proper structure, activation/deactivation hooks, and autoloading. Purpose: Establish the foundation that all other features will build upon. Output: Functional WordPress plugin that can be activated without errors. ~/.claude/get-shit-done/workflows/execute-plan.md ./summary.md @.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md **Tech stack:** WordPress 6.x, ACF Pro, Formidable Forms Pro, Elementor Pro **Constraints:** Must follow WordPress plugin standards, security best practices Task 1: Create main plugin file with header ddhh-job-manager.php Create main plugin file with WordPress plugin header: - Plugin Name: Digital Dabei Job Manager - Description: Closed job board for provider self-registration and mentor applications - Version: 1.0.0 - Author: digital dabei Hamburg - Text Domain: ddhh-job-manager - Domain Path: /languages Add security check: `defined('ABSPATH') || exit;` Define constants: DDHH_JM_VERSION, DDHH_JM_PLUGIN_DIR, DDHH_JM_PLUGIN_URL Include autoloader and main class file. Instantiate main class on plugins_loaded hook (priority 10). DO NOT use namespace yet — WordPress plugins traditionally use class prefixes for compatibility. Plugin appears in WordPress admin plugins list (check Plugin Name: header is valid) Main plugin file exists with valid header, constants defined, autoloader included Task 2: Create main plugin class with activation/deactivation includes/class-ddhh-job-manager.php, includes/class-activator.php, includes/class-deactivator.php Create `includes/class-ddhh-job-manager.php`: - Singleton pattern (private constructor, getInstance() method) - register_activation_hook() → DDHH_JM_Activator::activate() - register_deactivation_hook() → DDHH_JM_Deactivator::deactivate() - Store version in options on activation Create `includes/class-activator.php`: - activate() method - Check WordPress version >= 6.0 (wp_die if older) - Check PHP version >= 7.4 (wp_die if older) - Set option 'ddhh_jm_version' to current version - Flush rewrite rules ONCE (set transient flag, flush on next init if flag exists) Create `includes/class-deactivator.php`: - deactivate() method - Flush rewrite rules on deactivation - DO NOT delete data (user may reactivate) Use `wp_die()` for version checks, not exceptions. WordPress doesn't handle exceptions well during activation. Code follows WordPress Coding Standards, no syntax errors Classes created, activation checks present, rewrite rules flushed properly Task 3: Test plugin activation in Local WP environment N/A IMPORTANT: This task documents the testing steps but CANNOT be automated without access to Local WP environment. Manual verification required: 1. Copy plugin to Local WP: wp-content/plugins/ddhh-job-manager/ 2. Activate plugin in WordPress admin 3. Check for activation errors 4. Check admin notices 5. Verify version stored in options table This is a DOCUMENTATION task — the actual testing must be done by the user in their Local WP environment. User confirms plugin activates without errors in Local WP Plugin structure complete and ready for user testing in Local WP Before declaring plan complete: - [ ] All PHP files have `defined('ABSPATH') || exit;` security check - [ ] Plugin header is valid and parseable - [ ] Activation/deactivation hooks are registered - [ ] Version checks prevent activation on incompatible environments - All tasks completed - Plugin structure follows WordPress standards - Activation/deactivation hooks functional - Ready for user verification in Local WP environment After completion, create `.planning/phases/01-foundation-setup/01-01-SUMMARY.md`: # Phase 1 Plan 1: Plugin Structure Summary **WordPress plugin boilerplate created with activation/deactivation hooks** ## Accomplishments - Main plugin file with proper header and constants - Singleton pattern for main class - Activation with version/PHP/WP checks - Deactivation with rewrite flush - Security checks on all files ## Files Created/Modified - `ddhh-job-manager.php` - Main plugin file with header - `includes/class-ddhh-job-manager.php` - Main singleton class - `includes/class-activator.php` - Activation logic with checks - `includes/class-deactivator.php` - Deactivation logic ## Decisions Made - Used class prefix instead of namespace for WordPress compatibility - Singleton pattern for main class (WordPress convention) - Flush rewrites via transient to avoid multiple flushes ## Issues Encountered None ## Next Step Ready for 01-02-PLAN.md (can run in parallel)