A powerful WordPress plugin that integrates OpenAI's API to automatically generate content summaries for your posts and pages. This plugin provides an intuitive interface within the WordPress admin area to leverage AI-powered content automation.
- AI-Powered Summaries: Generate comprehensive summaries of your post content using OpenAI's GPT models
- WordPress Integration: Seamlessly integrates with the WordPress post editor as a meta box
- Real-time Generation: Generate summaries on-demand with AJAX-powered interface
- Modern UI: Clean, responsive interface with loading animations and notifications
- Error Handling: Robust error handling with user-friendly notifications
- Content Management: Store and manage AI-generated summaries as post metadata
- Regeneration Support: Easily regenerate summaries when content changes
- WordPress 5.0 or higher
- PHP 7.4 or higher
- OpenAI API key
- Active internet connection for API calls
- Download the plugin files
- Upload the
openai-automationfolder to your/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Configure your OpenAI API key in the settings
- Go to
Plugins > Add New - Upload the plugin zip file
- Click 'Install Now' and then 'Activate'
- Configure your API key in the settings
- Navigate to
Settings > OpenAI Automationin your WordPress admin - Enter your OpenAI API key in the provided field
- Click 'Save Changes'
- Visit OpenAI's website
- Create an account or log in
- Navigate to the API section
- Generate a new API key
- Copy the key and paste it into the plugin settings
- Create or Edit a Post: Go to any post or page in the WordPress editor
- Locate the Summary Box: Find the "OpenAI Summary" meta box in the sidebar (usually on the right)
- Generate Summary: Click the "Generate Summary" button
- Wait for Processing: The plugin will analyze your content and generate a summary
- Review Results: The generated summary will appear in the meta box
- Regenerate: Click "Regenerate Summary" to create a new summary
- Edit Content: Summaries are stored as post metadata and persist with your posts
- View Status: The interface shows loading states and success/error notifications
- Visual Indicators: Icons and status indicators for different states
- Loading Animation: Smooth animations during summary generation
- Notification System: Success and error messages with auto-dismiss
- Responsive Design: Works on desktop and mobile admin interfaces
- Generate Summary: Initial button for first-time generation
- Regenerate Summary: Appears after initial summary creation
- Loading State: Disabled buttons during processing
- Error Handling: Clear error messages for troubleshooting
Here are some screenshots illustrating the plugin's features and integration within WordPress:
-
WordPress Plugins Page: Shows the plugin listed on the WordPress plugins page, ready for activation or management.

-
Plugin Settings: Displays the dedicated settings page where users can configure their OpenAI API key.

-
Setting Dropdown with Plugin Settings Link Visible: Highlights how to access the plugin settings directly from the Settings list dropdown.

-
WordPress Posts Page: A general view of the WordPress posts list, showing how the plugin integrates with the overall admin interface.

-
WordPress Post Edit Page: A view of the standard WordPress post edit screen.

-
WordPress Post Edit Page with Plugin Visible: Shows the OpenAI Summary meta box integrated into the post edit page sidebar.

-
WordPress Post Edit Page Plugin Summarizing: Illustrates the plugin in action, with a loading indicator during the summary generation process.

-
WordPress Post Edit Page Plugin Summarized Successful: Displays a successfully generated summary within the meta box, along with a success notification.

This project includes several diagrams generated using PlantUML to illustrate its architecture and functionality. The source .puml files are located in the directory.
To render these diagrams into SVG images, you will need to have Java and PlantUML installed. You can download PlantUML from its .
Once PlantUML is installed, navigate to the directory in your terminal and run the following command for each .puml file:
java -jar /path/to/plantuml.jar <diagram_name>.pumlReplace /path/to/plantuml.jar with the actual path to your PlantUML JAR file and <diagram_name>.puml with the name of the diagram file (e.g., use_case_diagram.puml). This will generate an SVG file (e.g., use_case_diagram.svg) in the same directory.
openai-automation/
βββ openai-automation.php # Main plugin file
βββ openai-automation.js # Frontend JavaScript
βββ openai-automation.css # Styling
βββ blog-sample.md # Sample content
βββ screenshots/ # Directory containing plugin screenshots
βββ README.md # This file- Model Used: GPT-3.5-turbo-instruct (optimized for summarization)
- Token Limit: Up to 1000 tokens for summaries
- Content Limit: Handles up to 12,000 characters of input content
- Timeout: 60-second timeout for API requests
admin_init: Registers plugin settingsadmin_menu: Adds settings page to WordPress adminadd_meta_boxes: Adds summary meta box to post editoradmin_enqueue_scripts: Loads CSS and JavaScript fileswp_ajax_generate_openai_summary: Handles AJAX requests
To customize the AI prompt, edit line 118 in openai-automation.php:
'prompt' => 'Create a comprehensive summary of the following content, capturing the main points and key details: ' . $post_content,The plugin includes comprehensive CSS in openai-automation.css. Key classes:
.openai-summary-container: Main container.summary-actions: Button container.openai-notification: Notification messages.loading-state: Loading animations
The openai-automation.js file handles:
- AJAX requests to WordPress backend
- UI animations and state management
- Error handling and notifications
- Button interactions
- Nonce Verification: All AJAX requests include WordPress nonces
- Input Sanitization: User inputs are properly sanitized
- API Key Protection: API keys are stored securely in WordPress options
- Error Logging: Detailed error logging for debugging
"API key not set" Error
- Ensure you've entered your OpenAI API key in Settings > OpenAI Automation
- Verify the API key is valid and active
"Post content is empty" Error
- Make sure your post has content before generating a summary
- Save your post draft if working with new content
"Error connecting to OpenAI" Error
- Check your internet connection
- Verify your API key has sufficient credits
- Ensure OpenAI services are operational
Summary not appearing
- Check browser console for JavaScript errors
- Verify the meta box is visible in Screen Options
- Ensure the plugin is properly activated
To enable debug logging, add this to your wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);Check /wp-content/debug.log for detailed error information.
OpenAI charges based on token usage:
- Input tokens: Your post content
- Output tokens: Generated summary
- Typical cost: $0.001-0.01 per summary (varies by content length)
Monitor your usage in the OpenAI dashboard to manage costs effectively.
- v1.0: Initial release with core summarization features
- Multiple AI model support
- Bulk summary generation
- Custom prompt templates
- Summary scheduling
- Analytics and usage tracking
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This plugin is released under the GPL v2 license.
Divine Ikhuoria
For support, feature requests, or bug reports, please contact the author or create an issue in the project repository.
- OpenAI for providing the powerful API
- WordPress community for excellent documentation
- Contributors and testers
Note: This plugin requires an active OpenAI API subscription. Please review OpenAI's pricing and usage policies before implementation.