Files
Digital-Dabei-Hamburg-Job-M…/.planning/phases/01-foundation-setup/01-01-PLAN.md
Viktor Miller 8b296cefbe docs(01): create phase 1 plans
Phase 01: Foundation & Setup
- 3 plans created (all independent, can run parallel)
- 7 total tasks defined
- Ready for execution

Plans:
- 01-01: Plugin structure and activation hooks
- 01-02: Register job_offer CPT with capabilities
- 01-03: Register ddhh_provider role and ACF fields

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 18:47:23 +09:00

5.2 KiB

phase, plan, type, depends_on, files_modified
phase plan type depends_on files_modified
01-foundation-setup 01 execute
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.

<execution_context> ~/.claude/get-shit-done/workflows/execute-plan.md ./summary.md </execution_context>

@.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

<success_criteria>

  • All tasks completed
  • Plugin structure follows WordPress standards
  • Activation/deactivation hooks functional
  • Ready for user verification in Local WP environment </success_criteria>
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)