Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/gabrrrielll/ai-web-site-plugin/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
AI Web Site - WordPress Plugin
WordPress plugin for AI Website Builder with subdomain management via cPanel API.
🔌 Plugin Features
🏗️ Subdomain Management
- Create subdomains automatically via cPanel API
- Delete subdomains with confirmation
- List existing subdomains with management options
- Configure subdomain settings (directory, SSL, etc.)
📊 Site Configuration
- Store site configurations per subdomain
- JSON-based config management in WordPress database
- REST API endpoints for frontend integration
- Admin interface for configuration management
⚙️ Admin Interface
- User-friendly dashboard for subdomain management
- API key configuration (secure storage)
- Real-time status updates and error handling
- Bulk operations for multiple subdomains
📋 Installation
Method 1: Git Clone (Recommended)
-
Clone to WordPress plugins directory:
cd /path/to/wordpress/wp-content/plugins/ git clone https://github.com/gabrrrielll/ai-web-site-backend.git ai-web-site -
Activate Plugin:
- Go to WordPress Admin → Plugins
- Find "AI Web Site" plugin
- Click "Activate"
Method 2: Manual Upload
-
Download plugin files:
- Download ZIP from GitHub
- Extract to
wp-content/plugins/ai-web-site/
-
Activate Plugin:
- Go to WordPress Admin → Plugins
- Find "AI Web Site" plugin
- Click "Activate"
🔧 Configuration
Required Setup
- Go to AI Web Site → Settings in WordPress Admin
- Configure cPanel API (only 3 fields needed):
- cPanel Username: Your cPanel username (e.g.,
r48312maga) - cPanel API Token: Your cPanel API token (create in cPanel → Security → API Tokens; never commit tokens to git)
- Main Domain: Your main domain (e.g.,
ai-web.site)
- cPanel Username: Your cPanel username (e.g.,
API Configuration
The plugin handles:
- Subdomain creation via cPanel API
- Database storage for site configurations
- REST API endpoints for frontend communication
- Security validation for all operations
📡 REST API Endpoints
Base namespace: /wp-json/ai-web-site/v1
| Route | Method | Description |
|---|---|---|
/website-config/{domain} |
GET | Load website configuration by domain |
/website-config |
POST | Save website configuration |
/website/{domain} |
GET | Backward-compatibility endpoint for reading configuration |
/wp-nonce |
GET | Return WordPress nonce used for authentication |
/user-site/add-subdomain |
POST | Add subdomain for a user website |
/user-site/delete |
POST | Delete user website |
/ai/generate-text |
POST | Generate text using configured AI provider |
/ai/generate-image |
POST | Generate image using configured AI provider |
/site-config |
GET | Return site configuration by subdomain parameter |
/logs |
GET | Return debugging logs |
🧪 Postman Testing
Import these files in Postman:
- Collection:
/postman/ai-web-site-plugin.postman_collection.json - Environment:
/postman/ai-web-site-plugin.postman_environment.json
After import:
- Select the imported environment in Postman.
- Set
base_urlto your site URL (example:https://your-domain.com/wp-json/ai-web-site/v1). - Run
GET /wp-nonce(while authenticated in WordPress) and copy the returned nonce towp_nonceenvironment variable. - Run the remaining requests from the collection.
The collection also includes Postman test scripts (smoke checks) for each route:
- validates expected status codes per endpoint type
- validates JSON responses
- automatically stores
wp_noncefromGET /wp-nonceinto environment variable
🔄 Auto-Update
This repository is automatically updated when:
- Plugin improvements are made
- New features are added
- Bug fixes are implemented
📝 Plugin Structure
ai-web-site/
├── ai-web-site.php # Plugin header and initialization
├── includes/
│ ├── class-ai-web-site.php # Main plugin class
│ ├── class-cpanel-api.php # cPanel API integration
│ └── class-database.php # Database operations
├── admin/
│ ├── class-admin.php # Admin interface class
│ └── admin-page.php # Admin page template
└── assets/
└── admin.js # Admin interface JavaScript
🛡️ Security Features
- WordPress nonce verification for all admin actions
- User capability checks (admin only)
- Input sanitization and validation
- Secure API key storage in WordPress options
- CSRF protection on all forms
🚀 Usage
Creating a Subdomain
- Go to AI Web Site → Subdomains in WordPress Admin
- Click "Add New Subdomain"
- Enter subdomain name (e.g.,
example) - Configure settings (directory, SSL, etc.)
- Click "Create Subdomain"
Managing Site Configurations
- Go to AI Web Site → Site Configs
- Select subdomain from dropdown
- Edit JSON configuration
- Click "Save Configuration"
🔧 Development
Local Development
# Clone the plugin
git clone https://github.com/gabrrrielll/ai-web-site-backend.git
# Make changes to plugin files
# Test in local WordPress installation
# Deploy changes
npm run deploy:backend
Plugin Hooks
The plugin provides WordPress hooks for customization:
ai_web_site_before_subdomain_create- Before subdomain creationai_web_site_after_subdomain_create- After subdomain creationai_web_site_config_save- When site config is saved
📞 Support
For issues or questions:
- Check WordPress error logs
- Verify cPanel API token and permissions
- Review plugin settings in WordPress Admin
- Check GitHub issues for known problems
Plugin Version: 1.0.0
WordPress Compatibility: 5.0+
PHP Requirements: 7.4+