Skip to content

krtrimtech/wp-content-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AI Assistant WP Content Helper Sponsor

A powerful Grammarly-like AI writing assistant for WordPress, powered by Google Gemini API.

WordPress PHP License AI-powered writing assistance directly into your WordPress editor. Unlike other AI plugins, each user manages their own Google Gemini API key, ensuring privacy and individual control. The plugin seamlessly integrates with Gutenberg's toolbar, providing instant AI suggestions right where you write.

โœจ Features

  • ๐ŸŒ Multi-language Support - English + all major Indian languages
  • โœ๏ธ AI Text Improvement - Enhance clarity and grammar
  • โœ“ Grammar Checking - Find and fix errors with explanations
  • ๐ŸŽจ Content Rewriting - 6 different tones (professional, casual, friendly, etc.)
  • ๐Ÿ”„ Direct Text Replacement - Works like Grammarly - replaces text in-place
  • ๐Ÿ” Private API Keys - Each user uses their own Gemini API key
  • ๐ŸŽฏ Universal Compatibility - Works with Gutenberg, Classic Editor, and Elementor

๐ŸŽฅ How It Works

๐Ÿ“‹ Requirements

  • WordPress 5.8 or higher
  • PHP 7.4 or higher
  • Gutenberg Block Editor enabled
  • Google Gemini API key (free at Google AI Studio)

๐Ÿš€ Installation

Method 1: Manual Installation

  1. Download the plugin from this repository
  2. Upload the wp-content-helper folder to /wp-content/plugins/
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. Go to Dashboard โ†’ AI Assistant to add your API key

Method 2: Clone from GitHub

cd wp-content/plugins/
git clone https://github.com/krtrimtech/wp-content-helper.git

Then activate the plugin in WordPress admin.

๐Ÿ”‘ Getting Your API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Click "Create API Key"
  4. Copy your API key
  5. Go to WordPress โ†’ AI Assistant โ†’ Paste your key โ†’ Save

Note: The API key is completely free with generous usage limits!

๐Ÿ“– Usage Guide

Setup

  1. After activation, go to Dashboard โ†’ AI Assistant
  2. Paste your Google Gemini API key

Using AI Features

๐Ÿค– AI Improve (Quick Action)

  • Select any text in your post
  • Click the star icon (๐Ÿค–) in the toolbar
  • Your text is instantly improved and replaced

โœ“ Check Grammar

  • Select text you want to analyze
  • Click the checkmark icon (โœ“) in the toolbar
  • View detailed grammar suggestions in a modal
  • See your writing score (0-100)

โœ๏ธ Rewrite Content

  • Select text to rewrite
  • Click the edit icon (โœ๏ธ) in the toolbar
  • Choose your desired tone:
    • Professional
    • Casual
    • Friendly
    • Academic
    • Creative
    • Simple
  • Click "Rewrite" and review the result
  • Click "Replace Selected Text" to apply changes

๐ŸŒ Supported Languages

  • ๐Ÿ‡ฌ๐Ÿ‡ง English
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Hindi (เคนเคฟเค‚เคฆเฅ€)
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Bengali (เฆฌเฆพเฆ‚เฆฒเฆพ)
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Tamil (เฎคเฎฎเฎฟเฎดเฏ)
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Telugu (เฐคเฑ†เฐฒเฑเฐ—เฑ)
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Marathi (เคฎเคฐเคพเค เฅ€)
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Gujarati (เช—เซเชœเชฐเชพเชคเซ€)
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Kannada (เฒ•เฒจเณเฒจเฒก)
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Malayalam (เดฎเดฒเดฏเดพเดณเด‚)
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Punjabi (เจชเฉฐเจœเจพเจฌเฉ€)
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Urdu (ุงุฑุฏูˆ)

Hooks Used

  • admin_menu - Dashboard settings page
  • enqueue_block_editor_assets - Toolbar buttons
  • wp_ajax_* - AJAX handlers for AI requests

Security

  • Nonce verification for all AJAX requests
  • API keys stored per-user in WordPress user meta
  • Capability checks (edit_posts)
  • Input sanitization on all user inputs

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Setup

git clone https://github.com/krtrimtech/wp-content-helper.git
cd wp-content-helper
# Make your changes
# Test on a local WordPress installation

๐Ÿ“ File Structure

wp-content-helper/ โ”œโ”€โ”€ wp-content-helper.php # Main plugin file โ”œโ”€โ”€ includes/ โ”‚ โ”œโ”€โ”€ class-gemini-api.php # Gemini API handler โ”‚ โ”œโ”€โ”€ class-settings.php # Settings page โ”‚ โ”œโ”€โ”€ class-editor-button.php # Floating button & modal โ”‚ โ”œโ”€โ”€ class-ajax-handlers.php # AJAX endpoints โ”‚ โ””โ”€โ”€ prompts.php # AI prompts โ”œโ”€โ”€ assets/ โ”‚ โ”œโ”€โ”€ css/ โ”‚ โ”‚ โ””โ”€โ”€ editor-style.css # All CSS โ”‚ โ””โ”€โ”€ js/ โ”‚ โ””โ”€โ”€ editor-script.js # All JavaScript โ””โ”€โ”€ README.md # This file

text

๐Ÿ”ง Development

Adding New Features

  1. New AI Function: Add to includes/prompts.php
  2. New AJAX Endpoint: Add to includes/class-ajax-handlers.php
  3. New UI Element: Update assets/css/editor-style.css and assets/js/editor-script.js

Modifying Prompts

Edit includes/prompts.php to change how the AI responds:

public static function your_new_prompt($text) {
return "Your custom prompt here: {$text}";
}

๐Ÿ“ Changelog

Version 1.1.0 (Current)

  • Added inline toolbar buttons (Grammarly-style)
  • Added AI Improve quick action
  • Improved modal UI
  • Added support for 20+ languages
  • Better error handling

Version 1.0.0

  • Initial release
  • Basic grammar checking
  • Content rewriting
  • Dashboard settings page

๐Ÿ› Bug Reports & Feature Requests

Found a bug or have a feature idea? Please open an issue on GitHub!

๐Ÿ“„ License

This project is licensed under the GPL v2 or later - see the LICENSE file for details.

๐Ÿ‘จโ€๐Ÿ’ป Authors & Contributors

Created by: Krtrim

Contributor: Shyanukant Rathi

๐Ÿ™ Acknowledgments

  • Powered by Google Gemini API
  • Built for WordPress Gutenberg Block Editor
  • Inspired by Grammarly's inline editing experience

๐Ÿ“ž Support

Need help? Here's how to get support:

  1. Check the Usage Guide above
  2. Search existing issues
  3. Open a new issue if needed

โญ Show Your Support

If you find this plugin helpful, please consider:

  • Giving it a โญ star on GitHub
  • Sharing it with others
  • Contributing to the project

Made with โค๏ธ for the WordPress community

About

A Grammarly-like content writing assistant for WordPress with AI-powered suggestions

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors