# Changelog

=== Series Grid Changelog ===

= 4.0.1 =
* **Fix:** Enhanced Instance ID field instructions with explicit "no spaces" rule and multiple examples to prevent validation errors
* **Fix:** Improved user guidance for Instance Manager creation process
* **Change:** Version bump to 4.0.1 for release

## [4.0.0] - 2025-07-30

### 🎉 MAJOR FEATURE RELEASE - Multi-Instance System
- **🆕 Multi-Instance Manager:** Complete implementation of instance-based shortcode system allowing multiple layouts on the same page
- **🆕 Instance Shortcode Syntax:** `[series_grid id="homepage-grid" layout="grid" columns="3"]` - Each instance has unique ID and configuration
- **🆕 Admin Instance Manager:** Visual interface for creating and managing instances in PRO Advanced tab
- **🆕 Instance Override System:** Individual instances override global settings for complete customization

### Security & Compliance
- **Fixed WordPress Security Audit Errors:** Completely resolved all F12 Console Debug errors including 63 nonce verification warnings and 1 direct database query warning
- **Added Inline Nonce Verification:** Replaced separate security functions with inline `check_ajax_referer()` calls for PHPCS compatibility
- **Enhanced Input Sanitization:** Added comprehensive sanitization for `$_POST['exclude_posts']` parameter with `wp_unslash()`, `sanitize_text_field()`, and `array_map('absint')`
- **Replaced Direct Database Queries:** Replaced `$wpdb->get_results()` with WordPress API using `wp_load_alloptions()` for better compliance
- **Updated WordPress Core Dependencies:** Added proper `wp-includes/formatting.php` inclusion for sanitization functions

### Code Quality Improvements
- **PHPCS Compliance:** Eliminated all WordPress Coding Standards warnings
- **Clean Architecture:** Removed duplicate `get_default_settings()` method and reorganized code structure
- **Enhanced Error Handling:** Added comprehensive error handling for all AJAX operations
- **Documentation:** Updated WordPress USTAV SeriesGrid.txt with comprehensive security guidelines for future AI assistants

### Technical Improvements
- **Security Architecture:** Implemented proper public vs admin security separation
- **Constants Management:** Added all required WordPress constants at the top of file
- **File Structure:** Organized includes and dependencies properly
- **Inline Security:** Moved all security checks inline for PHPCS compatibility

### Performance & Compatibility
- **Cache Optimization:** Maintained existing caching systems while improving security
- **WordPress Version Compatibility:** Ensured compatibility with WordPress 5.5 - 6.8
- **PHP Version Support:** Maintained PHP 7.4+ support
- **Backward Compatibility:** All existing functionality preserved

---

## [3.0.0] - 2025-07-28

### Added
- **Horizontal Grid Layout (Free):** Added a new "Grid Image Position" option in the Basic tab with three settings: "Top" (classic vertical layout), "Left", and "Right" (new horizontal layouts). This allows for a more compact, list-style presentation within the grid.

### Changed
- **Admin UI:** The "Grid Image Position" setting is now context-aware and only appears when the "Grid" layout is selected, preventing confusion.
- **Admin UI:** Added clear warning messages in the admin panel to inform users that the introtext is automatically hidden in horizontal layouts for design purposes.

### Improved
- **CSS for Horizontal Layout:** Completely rewrote the CSS for the new horizontal layouts to use a robust, fixed-width image and flexbox for clean alignment. The design is now more compact and visually appealing.
- **Responsive Behavior:** In horizontal grid mode, the layout now automatically switches back to a vertical (image on top) stack on mobile devices for better readability.
- **Social Sharing Buttons:** Redesigned the CSS for social sharing buttons to display horizontally with even spacing, improving their appearance in all layouts.

### Fixed
- **CSS Conflict:** Resolved a critical CSS conflict where the `padding-top` method for aspect ratios was breaking the new horizontal `flexbox` layouts.
- **Introtext Behavior:** Ensured that the introtext is reliably hidden in horizontal layouts, preventing it from breaking the design.

---

## [3.0.0] - 2025-07-28

### Added
- **Show/Hide Introtext (Free):** Added a global option in the Basic tab to show or hide the introtext across all layouts (Grid, List, Slider).
- **Introtext on Hover (PRO):** Added a new PRO feature for the Grid layout that hides the introtext by default and reveals it with a smooth expand/collapse animation when the user hovers over an item.

### Changed
- **Plugin Version:** Bumped the version to 3.0.0 to ensure cache busting, forcing browsers to load the latest CSS for the new hover effect.

---

## [1.3.0] - 2025-07-19

### Added
- **Complete Joomla module feature parity** - All features from Joomla mod_seriesgrid now available
- **Category filtering** - Filter posts by specific category IDs
- **Featured posts only** - Option to display only featured posts
- **Sort options** - Sort by date (newest), title (A-Z), or random
- **Show category** - Display post category with optional link
- **Show date** - Display post publish date
- **Image extraction** - Extract first image from post content if no featured image
- **Fallback color** - Custom background color for posts without images
- **Image height control** - Set custom image height for list and slider layouts
- **Hover effects** - Show title on hover, show intro text on hover (grid only)
- **Lazy loading** - Optional lazy loading for images
- **AJAX loading** - Placeholder for future AJAX implementation
- **Custom empty message** - Customize message when no posts found
- **Organized admin panel** - Settings grouped into Basic, Display, and Advanced sections

### Improved
- **Font size system** - More specific CSS selectors with !important flags for reliable font sizing
- **Template structure** - Complete rewrite of all templates with proper fallback handling
- **CSS architecture** - Comprehensive responsive design with mobile-first approach
- **Image handling** - Robust fallback system with color/image options
- **Code organization** - Cleaner code structure with better variable sanitization

### Fixed
- **CSS loading** - Added proper wp_enqueue_style() for asset loading
- **Fallback image** - Corrected field name from 'fallback' to 'fallback_image'
- **Layout switching** - Proper template switching between grid/list/slider
- **Font sizes** - Fixed font size application with more specific CSS selectors
- **Variable scope** - All template variables properly defined with fallbacks

### Technical Improvements
- **WordPress standards** - Full compliance with WordPress coding standards
- **Sanitization** - Proper sanitization of all user inputs and outputs
- **Performance** - Optimized query handling and template loading
- **Accessibility** - Improved semantic HTML and ARIA attributes where appropriate

---

## [1.2.1-clean] - Previous version
- Basic grid/list/slider layout support
- Limited admin options
- Basic styling

---

## Notes
- This version brings Series Grid WordPress plugin to full feature parity with the Joomla module
- All new features are backward compatible
- Existing shortcodes will continue to work with new default settings