Major refactoring cleanup: - Add new controller architecture (class-controller-*.php) - Add new settings-v2 UI (views/settings-v2/) - Add new CSS architecture (agentic-sidebar.css, tokens) - Add esbuild build pipeline (scripts/build.js, package.json) - Add composer dependencies (vendor/) - Add frontend src directory (assets/js/src/index.jsx) - Add documentation files - Remove old/obsolete files (class-settings.php, old CSS) This commits all pending changes from previous refactoring efforts.
5.8 KiB
5.8 KiB
Changelog
All notable changes to WP Agentic Writer are documented in this file.
The format is based on Keep a Changelog.
[Unreleased]
Added
- REST API documentation: Added
docs/architecture/REST_API_ENDPOINTS.mdwith complete endpoint reference - Architecture refactor: Extracted REST controllers from
class-gutenberg-sidebar.phpinto dedicated controller classes (Controller_Chat,Controller_Cost,Controller_Models,Controller_Session,Controller_Conversation,Controller_Planning,Controller_Config,Controller_Writing,Controller_Refinement,Controller_Image) - Helper utilities: Extracted ~24 pure helper methods into
WP_Agentic_Writer_Sidebar_Helpersclass (class-sidebar-helpers.php): JSON extraction, plan normalization, block manipulation, refinement, SEO patterns, memory helpers - Rate limiting: Added
WPAW_Rate_Limiterclass for REST endpoint protection (30/min chat, 20/min search, 10/min content fetch) - Session locking: Added multi-tab safety via session locks (acquire, refresh, release)
Changed
- Post meta optimization: Bulk fetch post meta in sidebar initialization for reduced database queries
Fixed
- Sidebar logger recursion: Fixed wpawLog.error/log/warn calling themselves recursively (now call console.* directly)
- Sidebar syntax: Restored valid JavaScript syntax after debug logger conversion damaged string literals
- Session ID security: Session ID generation now uses
wp_generate_uuid4()for cryptographically secure uniqueness (requires DB migration for existing sessions) - Font loading: Fixed broken font loading in
agentic-sidebar.cssby correcting.wpaw-sidebar-containerselector and@importpaths - Dead stylesheet: Removed
settings-v2.cssfrom enqueue queue (was loaded but not used) - Cost tracker backward compatibility: Added
record_usage()method to match WP AI Client wrapper contract - Cost attribution: Added
record_usage_full()method for accurate model/provider attribution in cost records - Cost table self-heal: Added
SHOW TABLES LIKEguard beforeDESCRIBEto handle missing table scenario - Conversation table versioning: Fixed independent version tracking for conversations table vs. main plugin version
- Clear context behavior: Context service now clears all active sessions for a post when sessionId is not provided
- Deactivation cleanup: Now clears
wpaw_cleanup_old_sessionsscheduled hook - Legacy chat history migration:
migrate_legacy_chat_history()now deletes legacy meta and writes migration marker;get_context()performs migrate-on-read for posts with unmigrated legacy data - Legacy chat history deprecated:
update_post_chat_history()no longer writes to post meta; endpoint returns deprecation notice
Added
- Post-scoped authorization (complete sweep): Added
edit_postcapability checks to ALL post-scoped REST endpoints:handle_clear_context,handle_revise_plan,handle_block_refine,handle_refine_from_chathandle_seo_audit,handle_suggest_keywords,handle_suggest_improvements- Plus all previously fixed endpoints (chat, generate-plan, execute-article, reformat-blocks, regenerate-block, meta, image ops)
- Frontend debug logging: Added centralized debug logging utility (
wpawLog) that respects thewpAgenticWriter.debugflag - Schema sync: Cost tracking table
CREATEstatement now includes all columns (provider,session_id,status) with runtime migration fallback - Uninstall cleanup: Consolidated uninstall hooks and removed redundant code paths
Changed
- record_usage() deprecated: Marked
record_usage()as deprecated in docblock; userecord_usage_full()for accurate provider attribution - Session ID security: Changed session ID generation from
wp_hash()towp_generate_uuid4()for better uniqueness (requires DB migration)
Removed
- Legacy chat history: Post meta
_wpaw_chat_historyis deleted after successful migration (replaced by_wpaw_chat_history_migratedmarker) - Deprecated files: Moved
CREATE_TABLE.sql, emptylanguages/, and other unused files tolegacy/directory - Unused directories: Removed
tests/,admin/,deprecated/,stitch/directories (already moved tolegacy/)
[0.1.3] - 2025-05-24
Added
- Provider transparency: Provider selection now returns structured result with
selected_provider,actual_provider, andfallback_usedflags - Cost tracking enhancements: Extended cost tracking to capture provider name, session ID, and request status
- Authorization hardening: Added
edit_postcapability checks to REST API endpoints for writing state and conversations
Fixed
- OpenRouter cache conflict: Split single transient into separate keys for model IDs and model objects
- Provider contract mismatch: All provider calls now properly unwrap the
WPAW_Provider_Selection_Resultobject - Streaming chat variables: Added proper initialization for
accumulated_content,chunks_emitted,total_costbefore closure use - Post meta bloat: Stopped writing
_wpaw_chat_historyto post meta (conversations table is now the source of truth)
[0.1.2] - 2025-05-17
Fixed
- Clarification quiz flow improvements
- Block refinement hybrid implementation
- Language detection for multilingual content
[0.1.1] - 2025-05-10
Added
- Context optimization with summarization
- Intent detection for writing modes
- Block-based article structure with outline panel
Fixed
- Writing state persistence
- Session management improvements
[0.1.0] - 2025-05-01
Added
- Initial release of WP Agentic Writer
- Plan-first AI writing workflow: Scribble → Research → Plan → Execute → Revise
- Integration with OpenRouter API
- Gutenberg sidebar for AI assistance
- Cost tracking for API usage
- Image generation support