# Cookie Guard Changelog

## Version 1.0.6 - November 01, 2024

### Fixed - WordPress Repository Compliance
- **Security**: Fixed all input validation issues - added isset() checks for all $_POST variables
- **Security**: Fixed cookie sanitization using wp_unslash() and sanitize_text_field()
- **Security**: Fixed preferences array sanitization in AJAX handler
- **Database**: Fixed all prepared SQL statements using $wpdb->prepare()
- **Database**: Added proper phpcs:ignore comments for necessary direct database queries
- **Standards**: Replaced date() with gmdate() for timezone-safe date formatting
- **Standards**: Added phpcs:ignore for fopen()/fclose() in CSV export (required for php://output)
- **Standards**: Fixed nonce verification comments in GET parameter handling

### Technical
- All code now passes WordPress Coding Standards checks
- Ready for WordPress.org Plugin Directory submission
- Improved code security and best practices compliance
- Properly sanitized all user inputs
- Fixed database query preparation across all files

## Version 1.0.5 - November 01, 2024

### Fixed
- **Database Creation Timing**: Fixed automatic table creation to run immediately on plugin load instead of using plugins_loaded hook
- **Table Creation Logic**: Corrected hook timing issue that prevented automatic table creation

### Removed
- **Manual Table Creation**: Removed manual table creation button and warning notices
- **Simplified Admin**: Database table now creates automatically without user intervention

### Enhanced
- **Conditional Display**: Popup Position field now only shows when Banner Style is set to "Popup (Box)"
- **Improved UX**: Banner position options are hidden when using Bar (Full Width) style
- **Smart Form**: Settings form now intelligently shows/hides relevant fields

### Technical
- Fixed database check to run in constructor instead of delayed hook
- Added JavaScript toggle for popup position field visibility
- Improved settings page organization and user experience

## Version 1.0.4 - November 01, 2024

### Fixed
- **Automatic Table Creation**: Database table now creates automatically on plugin load
- **Fallback Check**: Added check_database() method that runs on every plugin load
- **Removed Manual Creation**: No longer need manual table creation button

### Enhanced
- **CSS Scoping**: All admin styles properly scoped under .cookie-guard-modern-wrapper
- **Frontend Scoping**: All frontend styles use .cookie-guard- prefix
- **Conflict Prevention**: Styles isolated to prevent theme/plugin conflicts
- **Better Activation**: Table creation guaranteed on both activation and load

### Technical
- Added plugins_loaded hook for database check
- Table existence check runs automatically
- Creates table if missing without user intervention
- All CSS selectors properly namespaced

## Version 1.0.3 - October 31, 2024

### Added
- **Popup Banner Style**: New option to display banner as a popup box instead of full-width bar
- **Banner Positioning**: Choose left, center, or right alignment for popup style
- **Maximum Width Control**: Set custom max width (300-2000px) for better control
- **Banner Style Options**: Switch between bar (full-width) and popup (box) styles

### Fixed
- **Input Field Styling**: Modernized text inputs to match textarea design
- **Color Picker Styling**: Enhanced with better hover effects and focus states
- **Select Dropdown**: Improved styling consistency across all form elements
- **Form Element Hover**: Added smooth hover transitions to all inputs

### Enhanced
- **Popup Animations**: Smooth scale and fade animations for popup style
- **Responsive Popup**: Better mobile handling for popup banners
- **CSS Variables**: Using CSS custom properties for max-width control
- **Modern Form Design**: All form elements now have consistent modern styling

## Version 1.0.2 - October 31, 2024

### Fixed
- **PHP Deprecated Warnings**: Fixed `number_format()` deprecated warnings when passing null values
- **Database Errors**: Resolved "Table doesn't exist" errors on fresh installations
- **Missing Table Handling**: Added proper table existence checks before all database queries
- **Stats Display**: All count values now properly cast to integers to prevent null errors

### Enhanced
- **Manual Table Creation**: Added "Create Table Now" button in admin for easy table creation
- **Better Error Messages**: Improved error messages with clear solutions when table is missing
- **Admin Notices**: Added helpful warning notice when database table doesn't exist

### Technical
- Added table existence checks in settings.php and logs.php
- All database count queries now cast results to integers
- Improved error handling throughout admin pages
- Better user experience when activation hook doesn't fire properly

## Version 1.0.1 - October 31, 2024

### Enhanced
- **Modern Dashboard Design**: Complete visual overhaul with glassmorphism effects
- **Improved Animations**: Smooth transitions and micro-interactions throughout the interface
- **Better Visual Hierarchy**: Enhanced typography and spacing for improved readability
- **Upgraded Form Elements**: Modern input fields with better focus states
- **Enhanced Color Picker**: Improved visual feedback and hover states
- **Sticky Save Bar**: Save button now sticks to the bottom for better accessibility
- **Mobile Responsive**: Better responsive design for all screen sizes

### Design Updates
- Added gradient overlays and depth effects to header
- Improved stat cards with hover animations and glassmorphism
- Enhanced tabs with pill design and smooth transitions
- Better button styles with modern hover effects
- Upgraded toggle switches with smoother animations
- Improved info boxes and feature lists
- Added fade-in animations for better UX

### Technical
- Clarified database table name (`wp_cookie_guard_consent_logs`) in code comments
- Optimized CSS for better performance
- Improved accessibility with better focus states
- Added modern CSS animations and transitions

## Version 1.0.0 - Initial Release
- GDPR compliant cookie consent banner
- Smart script blocking system
- Consent logging and management
- Customizable design options
- Page builder compatibility
