mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-17 18:21:46 -05:00
This PR adds WordPress integration to AutoGPT platform, enabling users to create posts on WordPress.com and Jetpack-enabled sites. ### Changes 🏗️ **OAuth Implementation:** - Added WordPress OAuth2 handler (`_oauth.py`) supporting both single blog and global access tokens - Implemented OAuth flow without PKCE (as WordPress doesn't require it) - Added token validation endpoint support - Server-side tokens don't expire, eliminating the need for refresh in most cases **API Integration:** - Created WordPress API client (`_api.py`) with Pydantic models for type safety - Implemented `create_post` function with full support for WordPress post features - Added helper functions for token validation and generic API requests - Fixed response models to handle WordPress API's mixed data types **WordPress Block:** - Created `WordPressCreatePostBlock` in `blog.py` with minimal user-facing options - Exposed fields: site, title, content, excerpt, slug, author, categories, tags, featured_image, media_urls - Posts are published immediately by default - Integrated with platform's OAuth credential system ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] OAuth URL generation works correctly for single blog and global access - [x] Token exchange and validation functions handle WordPress API responses - [x] Create post block properly transforms input data to API format - [x] Response models handle mixed data types from WordPress API The WordPress OAuth provider needs to be configured with client ID and secret from WordPress.com application settings.