diff --git a/.planning/phases/01-foundation/01-01-PLAN.md b/.planning/phases/01-foundation/01-01-PLAN.md new file mode 100644 index 0000000..ce4ec76 --- /dev/null +++ b/.planning/phases/01-foundation/01-01-PLAN.md @@ -0,0 +1,154 @@ +--- +phase: 01-foundation +plan: 01 +type: execute +depends_on: [] +files_modified: [umzugsliste.php, includes/class-cpt.php, includes/class-admin-menu.php] +--- + + +Establish WordPress plugin infrastructure with CPT for storing form submissions and admin menu structure. + +Purpose: Create the foundation that all subsequent features depend on — a properly registered plugin with data storage and admin interface. +Output: Working WordPress plugin with CPT registration, admin menu, and proper activation hooks. + + + +~/.claude/get-shit-done/workflows/execute-plan.md +./summary.md + + + +@.planning/PROJECT.md +@.planning/ROADMAP.md +@.planning/STATE.md + +**Project context:** +- Local by WP Engine development environment +- WordPress with Salient theme installed +- Plugin directory: `/Users/vmiller/Local Sites/siegel-liste/app/public/wp-content/plugins/umzugsliste/` +- Currently empty except for .planning/ and .git/ + +**WordPress standards:** +- Follow WordPress Coding Standards +- Use proper text domain: `umzugsliste` +- Namespace classes to avoid conflicts +- Security: Capability checks, nonce verification (where applicable) + + + + + + Task 1: Create main plugin file with bootstrap code + umzugsliste.php + +Create main plugin file with: +- WordPress plugin header (Plugin Name: Umzugsliste, Description, Version: 1.0.0, Author: Siegel Umzüge, Text Domain: umzugsliste, Domain Path: /languages) +- Security check (ABSPATH defined) +- Plugin version constant +- Main plugin class skeleton +- Activation/deactivation hooks (flush_rewrite_rules on activation for CPT) +- Autoloader or require statements for includes/ +- Init hook to initialize plugin components + +DO NOT use namespaces (WordPress core doesn't require them). Prefix class names with `Umzugsliste_` to avoid conflicts. +DO NOT add extensive inline documentation yet — focus on working code. + + Plugin appears in wp-admin Plugins list, can be activated without errors + umzugsliste.php exists, has valid plugin header, activates successfully, no PHP errors + + + + Task 2: Register Custom Post Type for form submissions + includes/class-cpt.php + +Create CPT registration class: +- Class: `Umzugsliste_CPT` +- Register `umzugsliste_entry` post type with labels (German: "Einträge", "Eintrag") +- Settings: public=false, show_ui=true, show_in_menu=false (we'll add to custom menu in Task 3), capability_type='post', supports=['title'], has_archive=false +- Title should be auto-generated from submission data in later phases — for now just support title +- No custom fields yet (Phase 6 will add email content storage) +- Register on `init` hook + +WHY show_in_menu=false: We want full control over menu structure in Task 3, not WordPress default placement. + + After activation, CPT registered (check with get_post_types() or inspect database wp_posts table capabilities) + CPT `umzugsliste_entry` registered, appears in WordPress (visible once we add menu in Task 3), no errors + + + + Task 3: Create admin menu structure + includes/class-admin-menu.php + +Create admin menu class: +- Class: `Umzugsliste_Admin_Menu` +- Add top-level menu on `admin_menu` hook: "Umzugsliste" with dashicons-list-view icon +- Position: 25 (below Comments, above Appearance) +- Capability: 'edit_posts' (editors and above can access) +- First submenu: "Einträge" (Entries) - links to edit.php?post_type=umzugsliste_entry (CPT list view) +- Second submenu: "Einstellungen" (Settings) - callback to placeholder function that displays "Settings coming in Phase 3" notice +- Remove the duplicate top-level menu item that WordPress auto-creates (remove_submenu_page) + +WHY remove duplicate: WordPress auto-adds first submenu as duplicate of parent — we want clean "Einträge" and "Einstellungen" only. + + Admin menu shows "Umzugsliste" with icon, contains "Einträge" and "Einstellungen" submenus, no duplicate entries + Top-level menu visible in wp-admin, submenus functional, Einträge shows CPT list (empty), Einstellungen shows placeholder message + + + + + +Before declaring plan complete: +- [ ] Plugin activates without PHP errors or warnings +- [ ] Admin menu "Umzugsliste" appears with icon in left sidebar +- [ ] Submenus "Einträge" and "Einstellungen" both functional +- [ ] Einträge shows CPT list view (empty but working) +- [ ] Einstellungen shows "coming in Phase 3" placeholder +- [ ] No JavaScript console errors + + + + +- All tasks completed +- All verification checks pass +- Plugin foundation ready for Phase 2 (data extraction) +- Clean activation/deactivation (no orphaned data) +- Admin interface accessible to editors and above + + + +After completion, create `.planning/phases/01-foundation/01-01-SUMMARY.md`: + +# Phase 1 Plan 1: Foundation Summary + +**WordPress plugin infrastructure established with CPT and admin menu** + +## Accomplishments + +- Main plugin file created with proper WordPress header and activation hooks +- Custom Post Type `umzugsliste_entry` registered for storing form submissions +- Admin menu structure created with Einträge and Einstellungen submenus +- Plugin activates cleanly in Local by WP Engine environment + +## Files Created/Modified + +- `umzugsliste.php` - Main plugin bootstrap file +- `includes/class-cpt.php` - CPT registration class +- `includes/class-admin-menu.php` - Admin menu structure class + +## Decisions Made + +- Used `Umzugsliste_` class prefix instead of namespaces (WordPress compatibility) +- Set CPT capability to 'edit_posts' (editors and above) +- Menu position 25 (below Comments) +- Text domain: `umzugsliste` for i18n readiness + +## Issues Encountered + +[None expected - standard WordPress patterns] + +## Next Phase Readiness + +Phase 1 complete. Ready for Phase 2: Legacy Data Extraction. +Phase 2 will extract furniture data from legacy PHP files into structured arrays. +