Update CLAUDE.md with session history and learnings
- Document all bug fixes and enhancements from 2026-02-03 session - Add learnings about Gutenberg vs classic editor for form-based post types - Document encryption implementation for guest data - Add notes on auto-draft handling and type safety Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
90
CLAUDE.md
90
CLAUDE.md
@@ -38,6 +38,10 @@ This project is proudly **"vibe-coded"** using Claude.AI - the entire codebase w
|
|||||||
|
|
||||||
**Note for AI Assistants:** Clean this section after the specific features are done or new releases are made. Effective changes are tracked in `CHANGELOG.md`. Do not add completed versions here - document them in the Session History section at the end of this file.
|
**Note for AI Assistants:** Clean this section after the specific features are done or new releases are made. Effective changes are tracked in `CHANGELOG.md`. Do not add completed versions here - document them in the Session History section at the end of this file.
|
||||||
|
|
||||||
|
### Known Bugs
|
||||||
|
|
||||||
|
No known bugs at this time.
|
||||||
|
|
||||||
## Technical Stack
|
## Technical Stack
|
||||||
|
|
||||||
- **Language:** PHP 8.3.x
|
- **Language:** PHP 8.3.x
|
||||||
@@ -653,3 +657,89 @@ Admin features always work; frontend requires valid license.
|
|||||||
- Merged to main (fast-forward)
|
- Merged to main (fast-forward)
|
||||||
- Tagged: `v0.6.0`
|
- Tagged: `v0.6.0`
|
||||||
- Pushed to origin: dev, main, v0.6.0
|
- Pushed to origin: dev, main, v0.6.0
|
||||||
|
|
||||||
|
|
||||||
|
### 2026-02-03 - Bug Fixes and Enhancements
|
||||||
|
|
||||||
|
**Completed:**
|
||||||
|
|
||||||
|
- Fixed gap between settings page tabs and tab content
|
||||||
|
- Changed `.nav-tab-wrapper` margin-bottom from 20px to 0
|
||||||
|
- Added explicit border-bottom to create seamless connection with tab content
|
||||||
|
- Added license bypass for localhost development environments
|
||||||
|
- Created `LicenseManager::is_localhost()` method
|
||||||
|
- Detects: localhost, 127.0.0.1, ::1, .local/.test/.localhost/.dev/.ddev.site domains, private IP ranges
|
||||||
|
- `is_license_valid()` now returns true for localhost environments
|
||||||
|
- Added "Development Mode" notice on license settings page and dashboard when localhost detected
|
||||||
|
- Expanded General Settings with business owner fields
|
||||||
|
- Added Address section: street, city, postal code, country
|
||||||
|
- Added Contact section: email, phone, website
|
||||||
|
- Added Social Media section: Facebook, Instagram, X (Twitter), LinkedIn, TripAdvisor
|
||||||
|
- Updated `save_general_settings()` with proper sanitization for all new fields
|
||||||
|
- Created subtabs on Pricing settings tab
|
||||||
|
- Three subtabs: Pricing Tiers, Weekend Days, Seasons
|
||||||
|
- Each subtab has its own save button and focused content
|
||||||
|
- Added CSS for subtab navigation styling
|
||||||
|
- Seasons subtab now shows priority column and direct link to Seasons Manager
|
||||||
|
- Implemented auto-updates system
|
||||||
|
- Created `src/License/Updater.php` class
|
||||||
|
- Integrates with WordPress plugin update system via `pre_set_site_transient_update_plugins`
|
||||||
|
- Provides plugin info for "View details" modal via `plugins_api` filter
|
||||||
|
- Uses license client's `checkForUpdates()` method
|
||||||
|
- Configurable check frequency (1-168 hours)
|
||||||
|
- Options for notifications enabled and auto-install enabled
|
||||||
|
- Automatic cache clearing when license settings change or after updates
|
||||||
|
- Added Updates tab to settings page
|
||||||
|
- Enable/disable update notifications
|
||||||
|
- Enable/disable automatic updates
|
||||||
|
- Configurable update check frequency
|
||||||
|
- Manual "Check for Updates" button with AJAX
|
||||||
|
- Display of last check timestamp and current version
|
||||||
|
- Reordered admin submenu for better organization
|
||||||
|
- Dashboard at top, Settings at bottom
|
||||||
|
- Logical grouping: Buildings, Rooms, Bookings, Guests, Services, Calendar, Seasons
|
||||||
|
- Fixed Booking admin issues
|
||||||
|
- Fixed auto-draft status causing type errors (check for WP_Post object)
|
||||||
|
- Fixed guest dropdown to always load existing guests
|
||||||
|
- Booking title now auto-generates with guest name and dates (room removed per user request)
|
||||||
|
- Fixed booking history display on Guest edit page
|
||||||
|
- Implemented guest auto-creation from booking form
|
||||||
|
- When new guest data is entered in booking, guest record is automatically created
|
||||||
|
- Links booking to the new guest via guest_id meta
|
||||||
|
- Added encryption for sensitive guest data
|
||||||
|
- ID/passport numbers encrypted using AES-256-CBC
|
||||||
|
- Uses WordPress AUTH_KEY for encryption key derivation
|
||||||
|
- `encrypt()` and `decrypt()` methods in Guest class
|
||||||
|
- Backward compatible with legacy unencrypted data
|
||||||
|
- Security notice displayed in Identification meta box
|
||||||
|
- Disabled Gutenberg block editor for form-based post types
|
||||||
|
- Service, Guest, and Booking post types now use classic editor
|
||||||
|
- Added `disable_block_editor()` filter to each post type class
|
||||||
|
- Meta boxes now appear properly instead of being hidden at bottom
|
||||||
|
- Form-based interfaces are more appropriate than block editor for data entry
|
||||||
|
|
||||||
|
**Files Changed:**
|
||||||
|
|
||||||
|
- `assets/css/admin.css` - Fixed tab gap, added subtab styles, booking form styles
|
||||||
|
- `assets/js/admin.js` - AJAX update check, booking form improvements, guest auto-creation
|
||||||
|
- `src/License/Manager.php` - Added `is_localhost()` method, updated `is_license_valid()`
|
||||||
|
- `src/License/Updater.php` - New file for auto-updates with configurable settings
|
||||||
|
- `src/Plugin.php` - Business owner settings, pricing subtabs, updates tab, menu reordering
|
||||||
|
- `src/PostTypes/Booking.php` - Auto-draft fixes, title generation, guest creation, disable Gutenberg
|
||||||
|
- `src/PostTypes/Guest.php` - AES-256-CBC encryption for ID numbers, disable Gutenberg
|
||||||
|
- `src/PostTypes/Service.php` - Disable Gutenberg for classic editor UI
|
||||||
|
|
||||||
|
**Learnings:**
|
||||||
|
|
||||||
|
- WordPress nav-tab styling expects tabs and content to be flush (no margin/gap)
|
||||||
|
- Localhost detection should cover common development TLDs (.local, .test, .dev, .ddev.site)
|
||||||
|
- Private IP ranges can be detected using `FILTER_FLAG_NO_PRIV_RANGE`
|
||||||
|
- WordPress plugin updates require hooking into `pre_set_site_transient_update_plugins` and `plugins_api`
|
||||||
|
- Subtabs can be implemented with query parameters and conditional rendering within a single settings callback
|
||||||
|
- URL fields should use `esc_url_raw()` for sanitization, email fields use `sanitize_email()`
|
||||||
|
- Always check if post object is valid (`$post instanceof \WP_Post`) before accessing properties - auto-draft causes issues
|
||||||
|
- AES-256-CBC encryption with random IV provides secure storage for sensitive data
|
||||||
|
- Store IV concatenated with encrypted data (IV is not secret, just needs to be unique)
|
||||||
|
- `use_block_editor_for_post_type` filter disables Gutenberg per post type
|
||||||
|
- Post types with `show_in_rest => true` get Gutenberg by default, which hides traditional meta boxes
|
||||||
|
- Form-based admin interfaces (data entry) should use classic editor, not block editor
|
||||||
|
|||||||
Reference in New Issue
Block a user