Commit Graph

69 Commits

Author SHA1 Message Date
25666a2509 debug(07-01): add detailed field value logging to registration 2026-01-14 21:58:21 +09:00
d6304d934a fix(07-01): use loose comparison for form ID check in registration handler
- Changed !== to != to allow type coercion
- Fixes registration not working due to string vs int comparison
- Added type debugging to help diagnose similar issues
2026-01-14 21:55:15 +09:00
7286133bf4 debug(07-01): add debug logging to registration handler 2026-01-14 21:40:35 +09:00
a00e28702f fix(07-01): replace deprecated FrmFormAction static calls with FrmFormActionsController
- Changed FrmFormAction::create() to FrmFormActionsController::create_action()
- Updated class_exists checks to use FrmFormActionsController
- Fixes fatal error on plugin activation with modern Formidable Forms
- Discovered during provider flow testing (Plan 07-01)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 21:26:59 +09:00
433b83bd8f docs(07): create phase plan
Phase 07: Testing & Polish
- 3 plans created
- 9 total tasks defined (all verification checkpoints + 1 checklist creation)
- Ready for execution

Plan breakdown:
- 07-01: Provider flow E2E test (register → submit → deactivate)
- 07-02: Mentor flow E2E test (browse → apply → opt-in)
- 07-03: Admin flow test + deployment checklist

All plans independent (can run in parallel)
2026-01-14 21:14:42 +09:00
d305d8b149 docs(06-03): complete async mentor notifications plan
Phase 6 Plan 3 complete. Async batch email notifications to opted-in
mentors on job publish without blocking admin workflow. Integrated with
Action Scheduler for background processing in batches of 50 users.
German email templates with job details, rate limit delays, error
logging, and unsubscribe hints.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 21:09:37 +09:00
6a2914f5fc feat(06-03): implement async batch email processor callback
Add process_mentor_notification_batch() method to process Action
Scheduler callbacks. Sends German email notifications with job details
(title, location, type, permalink) to batches of opted-in mentors.
Includes rate limit delay (0.1s between emails), error logging for
failures, and unsubscribe hint in email body. Registered callback for
'ddhh_jm_send_mentor_notification_batch' hook.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 21:09:01 +09:00
e24b4fa7f0 feat(06-03): add job publish hook to schedule mentor notifications
Add notify_mentors_on_job_publish() method to trigger async batch
notifications when jobs transition to publish status. Only triggers on
initial publish (not updates). Queries opted-in mentors via User
Preferences class and schedules batches via Scheduler class. Logs
notification scheduling with mentor count and batch count.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 21:08:23 +09:00
b87ac203fe docs(06-01): complete mentor notification opt-in plan
Tasks completed: 2/2
- User preferences class with notification opt-in meta
- Helper method to query opted-in mentors

SUMMARY: .planning/phases/06-email-notifications/06-01-SUMMARY.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 21:06:32 +09:00
2bfc666ddf docs(06-02): complete Action Scheduler integration plan
Tasks completed: 2/2
- Download and include Action Scheduler library
- Create scheduler helper class for email batch actions

SUMMARY: .planning/phases/06-email-notifications/06-02-SUMMARY.md
2026-01-14 21:05:31 +09:00
cae10e113c feat(06-02): create scheduler helper class for email batch actions
- Created DDHH_JM_Scheduler class with static setup_hooks() method
- Added schedule_mentor_notification_batch() method with 50-user batching
- Uses as_enqueue_async_action() with unique flag and email-notifications group
- Initialized in main plugin file and job manager class
- Ready for Phase 06-03 to register async action callbacks
2026-01-14 21:04:26 +09:00
48f270f6a5 chore(06-02): download and include Action Scheduler library
- Downloaded Action Scheduler 3.9.3 from GitHub
- Placed in vendor/action-scheduler/ directory
- Included in main plugin file before other code for proper initialization
- Library will auto-initialize itself when required
2026-01-14 21:03:48 +09:00
fd88dcf025 docs(06): create Phase 6 email notifications plans
Phase 6: Email Notifications
- 3 plans created
- 6 total tasks defined
- Parallel execution: 06-01 and 06-02 in Wave 1, 06-03 in Wave 2
- Ready for execution

Plans:
- 06-01: Mentor notification opt-in (2 tasks)
- 06-02: Action Scheduler integration (2 tasks)
- 06-03: Async batch email processing (2 tasks)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:59:56 +09:00
464e3d9a41 docs(roadmap): mark Phase 5 complete
All 4 plans completed:
- 05-01: Archive access control
- 05-02: Application form
- 05-03: Logo auto-crop
- 05-04: Single job post protection

Phase 5 complete - mentor job board backend infrastructure ready

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:52:26 +09:00
4f33f88d59 docs(05-04): complete job detail page plan
Summary documents single job post access control implementation,
completing Phase 5 backend infrastructure. Elementor template creation
is manual UI work through WordPress admin.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:51:17 +09:00
2e8bef56b8 feat(05-04): protect single job posts from public access
Add protect_single_job() method to access control class following the
same pattern as job archive protection. Non-logged-in users are
redirected to /anbieter-login/ when attempting to access individual
job_offer posts. Logged-in users (any role) can view job details.

Completes backend infrastructure for Phase 5 mentor job board. All ACF
fields and application form ready for Elementor template integration.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:51:11 +09:00
dd83b676b4 docs(05-04): create job detail page plan
Phase 05-04: Job Detail Page Protection
- 1 plan created
- 2 tasks defined (1 auto, 1 checkpoint:human-verify)
- Ready for execution

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:45:08 +09:00
64227dd6f6 docs(05-03): complete logo auto-crop plan
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:32:02 +09:00
26bac29074 docs(05-02): complete job application form plan
Created SUMMARY.md documenting:
- Job application form with email notification system
- Pre-filled email for logged-in mentors
- Provider receives full applicant context
- Direct reply capability for providers

Updated STATE.md:
- Phase 5 Plan 2 complete
- Added 4 decisions to accumulated context
- Updated velocity metrics

Updated ROADMAP.md:
- Marked 05-02 complete
- Updated progress to 2/4 for Phase 5

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:31:35 +09:00
87f07ba14a docs(05-01): complete archive access control plan
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:30:57 +09:00
318e00e2f9 feat(05-02): add application notification to providers
Add send_provider_application_notification() method:
- Hooks to frm_after_create_entry for job application form submissions
- Extracts applicant details (name, email, message) and job_id
- Fetches job details (title, location, type) from post and ACF fields
- Sends email to provider contact email (job_contact_email ACF field)
- Email includes full applicant info and job context
- Provider can reply directly to applicant email
- Error logging for missing contact email or wp_mail failures

Hook registered in setup_hooks() method

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:30:14 +09:00
75c2969c88 feat(05-01): create archive query helper for Elementor integration
Add DDHH_JM_Archive class to modify job archive queries. Ensures
Elementor Loop Grid displays only published jobs sorted by date
(newest first) with no pagination limit.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:30:00 +09:00
061a41033d feat(05-02): create job application form in Formidable class
Add create_job_application_form() method with 4 fields:
- applicant_name (text, required)
- applicant_email (email, required, pre-filled for logged-in users)
- applicant_message (textarea, required)
- job_id (hidden)

Form title: "Jetzt bewerben"
Submit button: "Bewerbung absenden"
Success message: "Ihre Bewerbung wurde versendet. Der Anbieter wird sich bei Ihnen melden."

Added get_job_application_form_id() helper method
Registered form creation in setup_registration_hooks()

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:29:39 +09:00
c8b911bd6b feat(05-03): register 200x200px cropped image size for job logos
Add register_image_sizes() method to DDHH_JM_Post_Types class that
registers 'job-logo' image size (200x200px with hard crop). Hook
method to after_setup_theme action for proper WordPress timing.

This enables Elementor templates to request consistent logo sizing
via wp_get_attachment_image() using size 'job-logo'. Auto-generates
cropped version when logos uploaded via ACF field.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:29:27 +09:00
e21de5a9e9 feat(05-01): add job archive access control
Protect job archive from public access by redirecting non-logged-in users
to /anbieter-login/. Only authenticated users (mentors/subscribers) can
browse the /jobangebote/ archive.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:29:18 +09:00
ac60de5d99 docs(05): create phase plan
Phase 05: Mentor Job Board
- 3 plans created (parallel-ready)
- 5 total tasks defined
- Ready for execution

Plans:
- 05-01: Archive access control and query setup
- 05-02: Job application form with provider notification
- 05-03: Logo auto-crop to 200x200px

All plans independent (depends_on: []), can execute in parallel.
2026-01-14 20:22:35 +09:00
4e407b3fe0 docs(04-02): complete deactivation notifications plan
Tasks completed: 1/1
- Add deactivation notification method to notifications class

Phase 4 complete - job deactivation system fully functional.

SUMMARY: .planning/phases/04-job-deactivation-system/04-02-SUMMARY.md
2026-01-14 20:08:59 +09:00
4a1c05c421 feat(04-02): add deactivation notification method to notifications class
- Added send_admin_job_deactivation_notification() method
- Hooks transition_post_status with guards: draft status AND old publish
- Extracts deactivation reason from ACF field job_deactivation_reason
- Email subject: "Stellenangebot deaktiviert: {job_title}"
- Email includes job details, provider info, and deactivation reason
- Sends to admin_email with edit link for review
- Error logging for missing admin_email or wp_mail failure

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:07:08 +09:00
639050279c docs(04-01): complete job deactivation form plan
Create SUMMARY.md documenting completed plan 04-01: job deactivation form with required reason field, ownership validation, and dashboard integration. Update STATE.md to reflect Phase 4 Plan 1 completion (12 plans total, 48% progress). Update ROADMAP.md to mark 04-01 as complete.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:04:52 +09:00
fbbd44a07b feat(04-01): add deactivate action to provider dashboard
Add deactivate mode detection alongside existing edit mode checking for action=deactivate_job and job_id parameter. When in deactivate mode, render deactivation form section similar to edit section structure with heading "Stellenangebot deaktivieren", back link to dashboard, and form shortcode with id_param={job_id}. In job listings table, add "Deaktivieren" button in Actions column only for published jobs (status === 'publish'). Deactivate button uses warning/destructive color (red background) to differentiate from edit/view buttons. Follow same conditional rendering pattern as edit mode showing deactivation form OR listings, not both.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:03:09 +09:00
e29a3e507f feat(04-01): create job deactivation form with reason field
Add create_job_deactivation_form() method following established pattern from create_job_edit_form(). Form includes deactivation_reason textarea (required, German label) and hidden job_id field. Configure Update Post action to set post_status='draft' removing job from public view. Map deactivation_reason to ACF meta field 'job_deactivation_reason'. Add ownership validation hook validate_job_deactivation_ownership() following same pattern as validate_job_ownership() to prevent URL tampering. Submit button: "Stellenangebot deaktivieren". Success message: "Ihr Stellenangebot wurde deaktiviert." Redirect to /anbieter-dashboard/. Add get_job_deactivation_form_id() helper following established pattern.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 20:02:23 +09:00
764cfe86f4 docs(04): create phase plan
Phase 04: Job Deactivation System
- 2 plans created
- 3 total tasks defined
- Ready for execution

Plan 04-01: Deactivation form with reason capture (2 tasks)
Plan 04-02: Admin notification on deactivation (1 task)
2026-01-14 19:58:51 +09:00
91e35c6ba2 docs(03): complete Phase 3 via parallel execution
Phase 3 (Job Management Core) executed with 4 parallel agents:
- 03-01: Job submission form (15 min)
- 03-02: Job edit form (12 min)
- 03-03: Admin notification (8 min)
- 03-04: Admin UI enhancements (15 min)

Execution waves:
- Wave 1: 03-01 (independent)
- Wave 2: 03-02, 03-03 (both depend on 03-01, no file conflicts)
- Wave 3: 03-04 (depends on 03-03 via shared files)

All 4 plans completed successfully with 0 failures.
Wall clock time: ~50 min (parallelized from ~60 min sequential estimate)

Updated:
- ROADMAP.md: Phase 3 marked complete
- STATE.md: Progress 44%, velocity metrics updated, decisions recorded

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:51:30 +09:00
4c9d9b4b24 docs(03-04): complete admin UI enhancements plan
Summary of Phase 3 Plan 4 execution:
- Custom admin columns for job moderation (provider, location, type, submission date)
- Status filter views with pending count badge
- Sortable columns for efficient workflow
- Admin-only hook loading for performance

All tasks completed successfully. Phase 3 complete.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:49:51 +09:00
797c8c7135 feat(03-04): integrate admin UI enhancements into plugin
Add admin UI class to main plugin bootstrap and initialize hooks in admin context only:
- Require class-admin-ui.php in main plugin file
- Initialize Admin_UI::setup_hooks() only when is_admin() is true
- Performance optimization: admin hooks don't load on frontend

Admin moderation interface now provides efficient job listing with custom columns and status filters.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:48:55 +09:00
a9cb056e7e feat(03-04): add custom admin columns for job moderation
Create DDHH_JM_Admin_UI class with custom columns for job_offer admin listing:
- Anbieter (provider org name + contact person from user meta)
- Standort (location from ACF field)
- Art (job type from ACF field)
- Eingereicht am (submission date)

Removed default author/date columns to reduce clutter. Made columns sortable for efficient moderation workflow.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:48:13 +09:00
9df86a3847 docs(03-02): complete job edit form plan
- Document job edit form implementation with ownership validation
- Track security implementation preventing URL tampering
- Record conditional template rendering pattern
- List modified files and technical decisions
- Mark plan complete, ready for 03-03 or 03-04

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:46:07 +09:00
71d65eee63 docs(03-03): complete admin notification plan
- Summary documents email notification system implementation
- Admin receives German email on new job submission
- Email includes job details and direct edit link
- Smart triggering prevents spam on updates
- All tasks completed, no deviations

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:45:34 +09:00
491c4fb535 feat(03-02): integrate edit form into provider dashboard
- Add edit mode detection via URL parameters (action=edit_job&job_id=X)
- Display edit form when in edit mode, hide listings table
- Update edit links in table to point to dashboard edit form
- Add back navigation link to return to dashboard overview
- Style edit section with card layout and back link
- Form pre-populates with existing job data via id_param
- Dashboard shows either edit form OR listings, not both

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:45:09 +09:00
943544e72b feat(03-03): integrate notifications into plugin initialization
- Added require statement for class-notifications.php in main plugin file
- Initialized notification hooks via init action in main class
- Pattern consistent with existing class initializations (Access_Control, Dashboard, etc.)
- Notifications will trigger on transition_post_status after WordPress fully loads

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:44:34 +09:00
a4e2fbfe17 feat(03-02): create job edit form with ownership validation
- Add create_job_edit_form() method to programmatically create edit form
- Form uses 'job_edit' key and matches submission form fields exactly
- Configure Update Post action to update existing job_offer posts
- Add validate_job_ownership() method with frm_validate_entry hook
- Security: Validates job_id parameter, post_type, and post_author match
- Prevents URL parameter tampering by malicious providers
- Add get_job_edit_form_id() helper method
- Form pre-populates from post ID via URL parameter

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:44:29 +09:00
7aeecae506 feat(03-03): create notification class with admin alert on job submission
- Created DDHH_JM_Notifications class with email notification system
- Hook into transition_post_status to detect new pending job submissions
- Send German email to admin with job details and edit link
- Email includes: title, author, org, location, type, date, edit link
- Only trigger on new → pending transition to avoid spam on updates
- Log errors if wp_mail() fails (common in Local WP)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:44:07 +09:00
9d0305c429 docs(03-01): complete job submission form plan
Summary of Phase 3 Plan 1 implementation:
- Created Formidable job submission form with 7 fields
- Configured Create Post action with pending status
- Mapped form fields to ACF fields
- Integrated form into provider dashboard
- 2 tasks completed, 2 files modified, 0 issues

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:42:14 +09:00
600e355c8d feat(03-01): add job submission form to provider dashboard
- Add job submission form section above job listings table
- Display form using Formidable shortcode with graceful fallback
- Add visual separation styling for form section (gray background, padding, border-radius)
- Wrap job listings in separate section for better organization

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:41:28 +09:00
650c7b05cd feat(03-01): add job submission form creation
- Add create_job_submission_form() method to DDHH_JM_Formidable class
- Create Formidable form with key 'job_submission'
- Add 7 fields with German labels: title, description, location, type, deadline, email, logo
- Configure Create Post action: post_type='job_offer', status='pending'
- Map form fields to ACF fields: job_location, job_type, job_deadline, job_contact_email, job_logo
- Add get_job_submission_form_id() helper method
- Hook form creation into init action

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:40:56 +09:00
9c0657039a docs(03): create phase 3 plans
Phase 3: Job Management Core
- 4 plans created
- 8 total tasks defined
- Ready for execution

Plans:
- 03-01: Job submission form (Formidable + ACF)
- 03-02: Job edit form with ownership validation
- 03-03: Admin email notification on submission
- 03-04: Admin moderation UI enhancements

Parallelization:
- Wave 1: 03-01, 03-02, 03-04 (independent)
- Wave 2: 03-03 (depends on 03-01)
2026-01-14 19:35:57 +09:00
193bef2953 docs: complete Phase 2 - Provider Registration & Auth
Phase 2 complete with all 4 plans executed in parallel:
- 02-01: Formidable registration form with auto-login
- 02-02: Combined login/registration page
- 02-03: Provider dashboard template
- 02-04: Access control and redirects

Total commits: 8 (5 feat + 3 docs)
Progress: 29% (2/7 phases complete)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:29:55 +09:00
ecb5c7ca45 docs(02-04): complete access control and redirects plan
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:27:51 +09:00
f5538ef5d8 docs(02-02): complete login/registration page plan
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:26:46 +09:00
4706f72ba4 feat(02-04): implement WP-Admin redirect for providers
- Create DDHH_JM_Access_Control class with redirect logic
- Redirect providers from WP-Admin to dashboard page
- Preserve access to profile.php for password/email changes
- Preserve access to admin-ajax.php for AJAX requests
- Integrate access control hooks in main plugin class

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 19:26:28 +09:00