# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.2] - 2026-02-14

### Added
- **Multiple Article Presets**: New preset management system for article generation settings (language, writing style, tone, search intent, point of view, creativity level, audience, additional prompt, and more)
- **Preset CRUD on Settings Page**: Create, edit, and delete presets from the GhostWriter Settings page with AJAX-powered save/delete
- **Preset Selector in All Modals**: Preset dropdown added to Generate, Rewrite, Generate by Category, and Support Article modals with auto-fill on selection
- **Related Article Label per Preset**: Configurable "Related Article Label" text (e.g. "Related Article", "Artikel Terkait") stored per preset and used when inserting related article links
- **Live Preview for Related Article Label**: Settings page shows a real-time preview of the related article label using actual published posts
- **Auto-migration to Presets**: Existing default settings are automatically migrated into a "Default" preset on first load

### Changed
- **Settings Page Redesigned**: Removed old individual default settings form; presets are now the sole source of truth for article generation defaults
- **Default Preset Auto-selected**: The "Default" preset is automatically selected and applied when opening any article generation modal
- **PHP Defaults from Preset**: Generate/Rewrite modal initial values now read from the "Default" preset instead of individual `get_option()` calls

### Fixed
- **Preset Not Applied in Generate by Category**: Fixed preset dropdown change not updating form fields in cloned forms (Generate by Category, Support Article) by adding proper CSS class for event delegation
- **Checkboxes Not Following Preset**: Fixed "Enable Related Articles", "Generate Image", and "Allow Related Keywords" checkboxes not updating when switching presets
- **Related Article Label Not Sent to Server**: Fixed `related_article_label` not being included in AJAX POST data for all generation types (generate, rewrite, category, suggestion)
- **Related Article Label Not Passed to Builder**: Fixed `build_related_articles_html()` to accept label from form submission instead of only reading from old `get_option()`

## [1.3.1] - 2026-02-08

### Added
- **Auto Google Index**: New feature to automatically submit post and page URLs to Google Indexing API when published or updated
- **Google Indexing API Integration**: Full integration with Google's Indexing API using service account authentication (JWT/OAuth2)
- **Submission Log**: Comprehensive logging system with database table to track all submission attempts (success/failure) with pagination
- **Encrypted Service Account Storage**: Service account JSON keys are encrypted using AES-256-CBC before storing in database
- **Test Connection Feature**: Built-in test connection button to verify Google Indexing API credentials before enabling auto-submission
- **Setup Guide with Tutorial Link**: Added step-by-step setup guide with link to full tutorial at https://api.co.id/blog/auto-index-ghostwriter/
- **Auto-submit on Publish/Update**: Automatically submits URLs to Google when posts or pages are published or updated (for post and page post types only)
- **Log Management**: View submission history with status indicators, source tracking (auto/test), and clear logs functionality

### Technical Details
- New database table: `wp_apicoid_gw_google_index_log` for storing submission logs
- New admin page: "Auto Google Index" submenu under GhostWriter menu
- JWT/OAuth2 authentication implementation without external dependencies
- AES-256-CBC encryption for service account keys using WordPress AUTH_KEY

## [1.3.0] - Previous Release

### Added
- Generate Article by Category: New feature to generate article suggestions based on selected category
- Auto link related articles: When generating articles from category suggestions, the plugin automatically includes contextual links to related articles from the same category
- Enhanced category-based workflow: Streamlined workflow for generating multiple articles from a single category with intelligent suggestion system
- Improved modal layout: Two-column layout for category suggestions and article generation form for better user experience
- Category suggestion API integration: Integrated with Api.co.id's category-based article suggestion endpoint for intelligent content recommendations

## [1.2.4] - Previous Release

### Added
- Added pagination to Article Generator page: Implemented pagination for the article list with configurable page size
- Configurable articles per page: Added setting in Settings page to configure number of articles displayed per page (default: 30)
- Improved article list navigation: Added pagination controls with page numbers, previous/next buttons, and "Showing X-Y of Z posts" information

## [1.2.3] - Previous Release

### Added
- Generate image from media library: Added "Generate Image" button in WordPress media library sidebar

### Fixed
- Fixed duplicate image insertion: Fixed issue where clicking "Insert into post" after generating an image would insert the image twice

### Changed
- Code cleanup: Removed all console.log statements for production-ready code

## [1.2.2] - Previous Release

### Added
- Add more configurable functions: Added optional "Treat as Support Article" checkbox when generating articles from suggestions

### Fixed
- Fix generate image button not showing on empty featured image: Fixed issue where the "Generate Featured Image" button was not appearing in the Classic Editor when no featured image was set

### Changed
- Improved featured image generation: Featured image now updates dynamically without page reload in Block Editor

## [1.2.1] - Previous Release

### Added
- Generate featured image from post edit page: Added "Generate Featured Image" button in the Featured Image meta box on post edit pages

## [1.2.0] - Previous Release

### Added
- Auto generate support article: New feature to automatically generate support articles for published articles with intelligent linking to pillar articles

### Fixed
- Fix API key validation not working: Fixed issue where API key validation button was not functioning properly

## [1.1.0] - Previous Release

### Added
- Smarter AI: Enhanced AI capabilities for better content generation
- Compressed image + WebP format: Images are now automatically compressed and converted to WebP format for better performance
- Added more settings: Configurable related articles feature, additional customization options in generate and rewrite forms
- Added plugin action links: Quick access to GhostWriter settings from plugins page

### Fixed
- Bugfix: Fixed issue where articles and images were not being generated properly

## [1.0.0] - Initial Release

### Added
- AI-powered article generation
- Content rewriting from URL
- Automatic related article linking
- SEO plugin integration
- Image generation support
- Category management
- Settings management
- Secure API key validation

[1.3.2]: https://github.com/apicoid/ghostwriter/compare/v1.3.1...v1.3.2
[1.3.1]: https://github.com/apicoid/ghostwriter/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/apicoid/ghostwriter/compare/v1.2.4...v1.3.0
[1.2.4]: https://github.com/apicoid/ghostwriter/compare/v1.2.3...v1.2.4
[1.2.3]: https://github.com/apicoid/ghostwriter/compare/v1.2.2...v1.2.3
[1.2.2]: https://github.com/apicoid/ghostwriter/compare/v1.2.1...v1.2.2
[1.2.1]: https://github.com/apicoid/ghostwriter/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/apicoid/ghostwriter/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/apicoid/ghostwriter/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/apicoid/ghostwriter/releases/tag/v1.0.0
