1. Overview

1.1 What is SD-Chat?

SD-Chat is a WordPress plugin that integrates a ChatGPT-powered assistant into your website. It allows site owners to:

  • Provide immediate, AI-driven responses to user questions.
  • Classify messages with custom conversation “paths” for specialized handling (e.g., spam detection, meeting requests).
  • Track conversations for analytics and automation.

1.2 Key Features

  • Live Chat Widget: A floating chatbox where users can interact with the AI assistant.
  • Admin Dashboard: View conversations, manage conversation paths, and set up guidance directives.
  • Custom Classifications: Block spam or prompt the AI for specific meeting requests, support topics, etc.
  • Hourly Summaries: Optional email reports about recent conversations.
  • Automatic IP Blocking (optional) for spam or malicious traffic.

2. Requirements

  • WordPress 5.2+ (tested up to WordPress 6.x).
  • PHP 7.4 or higher (8.0+ recommended).
  • A valid ChatGPT API Key (OpenAI or whichever API you’re using).
  • Sufficient server resources (memory, execution time) to handle AI calls.

3. Installation

3.1 Upload the Plugin

  1. After successfully purchasing a subscription, the zip file will download on your computer automatically.
  2. In your WordPress Admin Dashboard, go to Plugins → Add New → Upload Plugin.
  3. Select sd-chat.zip, then click Install Now.
  4. Once installed, click Activate.

3.2 Verify Activation

  • After activation, you should see a “ChatGPT Assistant” menu item in the WordPress admin sidebar.

4. Initial Setup and Configuration

4.1 API Key Configuration

  1. Go to ChatGPT Assistant → Configuration (sub-menu).
  2. Under ChatGPT API Key, paste your API key.
  3. Assistant Name: Provide a friendly name for your AI assistant (e.g., Olivia).
  4. System Message: (Optional) Provide instructions that will always be included to guide the AI’s behavior (e.g., “You are a helpful customer service agent…”).
  5. Debug Mode: If you enable it, blocking actions (like spam IP blocking) are disabled. Useful for testing.
  6. External Script API Key: You were emailed a this key when you first setup your subscription along with your username and password. If you are unable to locate your external key, it can be found in your account.

4.2 Save and Validate

  1. Click Save Changes.
  2. You should see a “Settings saved successfully.” message.

5. Creating Database Tables (Activation Hooks)

SD-Chat automatically creates the following tables on activation database prefix will vary with your WordPress setup:

  • wp_chatgpt_conversations – Stores all chat messages.
  • wp_chatgpt_paths – Holds classification paths (e.g., spam, meeting_request).
  • wp_chatgpt_blocked_ips – (Optional) IPs blocked for spam.
  • wp_chatgpt_guidance_logs – Logs system guidance messages for special paths.

If you have any issues (e.g., tables not created), deactivate and reactivate the plugin to trigger the creation hooks again.


6. Setting Up Classification Paths

6.1 Default Paths

  • Spam: Blocks suspicious or repetitive spam content.
  • Meeting Request: Guides the AI to gather scheduling info from users.

6.2 Create or Edit Paths

  1. Go to ChatGPT Assistant → Classifications.
  2. Add New Path: Provide a name (e.g., pricing_inquiry), a short directive about how to handle it, a system directive if needed, and if it should block the user.
  3. Priority: The plugin checks for matching paths in ascending order. Lower number = higher priority.

6.3 Use Cases

  • Spam: If “bot” or “spam” keywords are detected, block them.
  • Meeting Request: Prompt for date/time, contact info, and location.
  • Sales Inquiry: Provide product details, pricing, or link to a purchase page.

7. Using the Chatbox on Your Site

7.1 Front-End Widget

When the plugin is active:

  • A floating chat widget appears on every page (by default). This is useful when it is being used to navigate customers through your site. the chat information saves across pages.
  • Visitors can click to expand or close it.

7.2 Chat Flow

  1. User Types a message.
  2. AI Classifies it according to your paths.
  3. If blocked as spam, conversation ends or the IP is flagged (unless debug mode is on).
  4. Otherwise, the AI responds with relevant text, optionally guided by your System Message and system directives.

7.3 Admin Viewing

  • Go to ChatGPT Assistant → Conversations to view transcripts.
  • You can open any conversation to see the user and AI messages.

8. Hourly Conversation Reports

8.1 Enabling / Disabling

  • The plugin schedules by default.
  • It sends an email to admin_email with the transcripts of the last hour’s conversations.

8.2 Customizing

  • If you prefer daily or weekly, you can adjust or remove the scheduler.

9. Debugging and Troubleshooting

9.1 Common Issues

  1. Empty Responses
    • Confirm your ChatGPT API key is valid.
    • Check for server or firewall blocks.
    • See if your server logs contain cURL or wp_remote_get errors.
  2. Chatbox Not Appearing
    • Check if the plugin scripts are enqueued (look in browser dev tools).
    • Deactivate other plugins to rule out conflicts.
  3. Tables Not Created
    • Deactivate and reactivate the plugin.
    • Ensure your database user has CREATE privileges.
  4. Spam Blocking Everyone
    • Verify the spam path is correct and not matching normal user input.
    • Disable block_action on that path or uncheck debug_mode if you’re testing.

9.2 Logs and WP_DEBUG

  • Enable WordPress debug in wp-config.php:
  • define('WP_DEBUG', true);
  • define('WP_DEBUG_LOG', true);
  • define('WP_DEBUG_DISPLAY', false);
  • Look at wp-content/debug.log for errors.

9.3 External Script Errors

  • If you see parse errors from an externally fetched script, check the code snippet that’s being injected. Look at the debug logs for syntax issues.

10. Frequently Asked Questions (FAQ)

Q1: Can I style the chat widget?
A1: Yes. Modify css/style.css or override classes in your theme’s stylesheet.

Q2: How do I hide the chat widget on certain pages?
A2: Add a small check in your theme or use custom code to dequeue the script on those pages (e.g., check is_page('contact')).

Q3: Can I log user email or name?
A3: You can customize the front-end form to ask for user info, then store it in the conversation table. Make sure to comply with privacy rules (GDPR, etc.).

Q4: How do I integrate with other forms or automation?
A4: You can tap into WordPress hooks or add custom triggers in the plugin code to call external APIs or CRMs.


11. Future Enhancements

  • Multi-language support
  • Advanced analytics (conversation sentiment, funneling, etc.)
  • Theme templates for deeper front-end integration
  • Dashboard widgets summarizing conversation stats

12. Contact & Support

  • For bug reports or feature requests, discuss it with Olivia our online assistant and we will make it happen! You can also submit bugs here
  • Email: sales@synchrodynamic.com

Thank You for Using SD-Chat!

This documentation should help you install, configure, and manage your SD-Chat plugin. With the AI chatbox, you’ll add a powerful conversational front-end to engage users, handle queries, and keep spam at bay.

Conversation