QueryMind
AI-powered WordPress plugin to query your database using natural language. Ask questions in plain English, get instant SQL results. Supports WooCommerce, LearnDash, MemberPress. Uses OpenAI GPT-4 or Anthropic Claude. Safe, read-only queries with comprehensive validation.
by Engr Mejba Ahmed · github.com/mejba13/querymind · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/mejba13/querymind/archive/refs/heads/main.zipQueryMind - AI-Powered Database Explorer for WordPress
Ask questions about your WordPress data in plain English. Get instant answers powered by AI.
Overview
QueryMind is an AI-powered WordPress plugin that enables users to query their database using natural language. Instead of writing SQL or navigating complex admin panels, simply ask questions like:
- "How many orders did we get last month?"
- "Who are my top 10 customers by revenue?"
- "Show me all users who haven't logged in for 30 days"
- "What's the average order value this quarter?"
Features
- Natural Language Queries - Ask questions in plain English
- AI-Powered - Uses OpenAI GPT-4 or Anthropic Claude for intelligent SQL generation
- Safe & Secure - Read-only queries with comprehensive SQL validation
- WooCommerce Support - Deep integration with orders, products, and customers
- Visual Results - View results in tables with CSV export
- Query History - Track all your past queries
- Saved Queries - Save frequently used queries for quick access
- Role-Based Access - Configure which user roles can use QueryMind
Supported Integrations
| Integration | Status |
|---|---|
| WordPress Core | Full Support |
| WooCommerce | Full Support |
| LearnDash | Full Support |
| MemberPress | Full Support |
| Easy Digital Downloads | Full Support |
| Gravity Forms | Full Support |
Requirements
- PHP 8.0 or higher
- WordPress 6.0 or higher
- MySQL 5.7+ or MariaDB 10.3+
- OpenAI API key or Anthropic API key
Installation
- Download the plugin zip file or clone this repository
- Upload to
/wp-content/plugins/querymind - Activate the plugin through the WordPress admin
- Go to QueryMind > Settings and enter your API key
- Start querying your data!
# Clone the repository
git clone https://github.com/mejba13/querymind.git
# Navigate to WordPress plugins directory
cd /path/to/wordpress/wp-content/plugins/
# Move the plugin
mv querymind ./
Configuration
API Keys
QueryMind supports multiple AI providers:
| Provider | Models | Get API Key |
|---|---|---|
| OpenAI | GPT-4o, GPT-4o-mini, GPT-4-turbo | platform.openai.com |
| Anthropic | Claude 3.5 Sonnet, Claude 3 Opus | console.anthropic.com |
Settings
| Setting | Default | Description |
|---|---|---|
| Max Rows | 1000 | Maximum rows returned per query |
| Query Timeout | 30s | Maximum query execution time |
| Daily Limit | 20 | Queries per user per day (0 = unlimited) |
| Cache Duration | 1 hour | Schema cache duration |
Usage
Basic Queries
"How many posts do we have?"
"Show me the 10 most recent users"
"What's the total number of comments this month?"
WooCommerce Queries
"What was our revenue this month?"
"Show me top 10 customers by total spend"
"How many orders are pending?"
"What is our average order value?"
"Which products sold the most last week?"
Advanced Queries
"Show me users who registered but never made a purchase"
"What's the revenue breakdown by country?"
"List products that haven't sold in 30 days"
Security
QueryMind takes security seriously:
- Read-Only Queries - Only SELECT statements are allowed
- SQL Validation - All queries are validated before execution
- Blocked Keywords - DELETE, UPDATE, INSERT, DROP, ALTER, etc. are blocked
- Row Limits - Automatic LIMIT clause enforcement
- Execution Timeout - Queries are terminated if they exceed the timeout
- Role-Based Access - Only authorized users can run queries
- No Data Transmission - Your actual data never leaves your server
File Structure
querymind/
├── querymind.php # Main plugin file
├── uninstall.php # Clean uninstall
├── readme.txt # WordPress.org readme
├── README.md # GitHub readme
├── includes/
│ ├── admin/ # Admin interface
│ ├── api/ # REST API endpoints
│ ├── ai/ # AI provider integrations
│ ├── core/ # Core functionality
│ ├── integrations/ # Plugin integrations
│ └── utils/ # Utilities
├── assets/
│ ├── css/ # Stylesheets
│ └── js/ # JavaScript
└── languages/ # Translations
REST API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /wp-json/querymind/v1/query |
Execute natural language query |
| GET | /wp-json/querymind/v1/schema |
Get database schema |
| GET | /wp-json/querymind/v1/suggestions |
Get query suggestions |
| GET | /wp-json/querymind/v1/history |
Get query history |
| POST | /wp-json/querymind/v1/saved |
Save a query |
| GET | /wp-json/querymind/v1/saved |
List saved queries |
| DELETE | /wp-json/querymind/v1/saved/{id} |
Delete saved query |
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the GPLv2 or later - see the LICENSE file for details.
Author
Engr Mejba Ahmed
Support
Changelog
1.0.0
- Initial release
- Natural language to SQL conversion
- OpenAI and Anthropic support
- WooCommerce, LearnDash, MemberPress integrations
- Query history and saved queries
- CSV export
- Comprehensive SQL validation and security