WordPress Integration
Add FeedbackLoop AI to your WordPress site with a dedicated plugin. Automatic widget injection, post improvement suggestions, and deep integration with the WordPress ecosystem.
Overview
The FeedbackLoop AI WordPress plugin provides:
- Automatic widget injection — The feedback widget and session replay tracker are injected via the
wp_footerhook. No manual code editing required. - Post improvement suggestions — The AI analyzes your WordPress posts and suggests improvements based on user feedback patterns.
- Admin settings page — Configure API credentials and widget behavior from the familiar WordPress admin interface.
- Continuous improvement loop — Feedback from the widget is automatically applied to improve your content when approved.
Plugin Installation
Method 1: Upload ZIP (Recommended)
-
Download the plugin ZIP
Download the latest
feedbackloop-ai.zipfrom the GitHub Releases page. -
Upload via WordPress admin
Go to Plugins > Add New > Upload Plugin. Choose the ZIP file and click Install Now.
-
Activate the plugin
After installation, click Activate Plugin. The FeedbackLoop AI settings page will appear under Settings > FeedbackLoop AI.
Method 2: Manual Copy
For manual installation (e.g., via SSH or FTP):
# Copy plugin to WordPress plugins directory
cp -r feedbackloop-ai /var/www/html/wp-content/plugins/
# Set correct permissions
chown -R www-data:www-data /var/www/html/wp-content/plugins/feedbackloop-ai
Then activate the plugin from Plugins in the WordPress admin.
Configuration
Navigate to Settings > FeedbackLoop AI in the WordPress admin. You will need to fill in four fields:
| Field | Description | Where to Find It |
|---|---|---|
API URL |
The full URL of your FeedbackLoop AI instance (e.g., https://feedback.yoursite.com). |
Your server setup or the setup wizard output. |
API Key |
The public API key for your tenant. Used to identify which tenant this WordPress site belongs to. | Admin dashboard > Tenants > your tenant > API Key. |
API Secret |
The secret key for server-to-server communication. Used for authenticated requests like post improvement suggestions. | Admin dashboard > Tenants > your tenant > API Secret. |
WP Secret |
A shared secret between WordPress and the FeedbackLoop AI server. Used to verify webhook authenticity for content updates. | Generate a random string and set it in both WordPress settings and the tenant configuration. |
Use a strong, random string for the WP Secret. You can generate one with: openssl rand -hex 32
How It Works
Widget Injection
Once configured, the plugin hooks into wp_footer and injects the FeedbackLoop AI widget script on every page of your WordPress site. The widget loads asynchronously and does not block page rendering.
// The plugin automatically injects this via wp_footer:
add_action('wp_footer', function() {
$api_url = get_option('feedbackloop_api_url');
$api_key = get_option('feedbackloop_api_key');
$api_secret = get_option('feedbackloop_api_secret');
echo '<script src="' . esc_url($api_url) . '/unified/feedbackloop.js"
data-api-key="' . esc_attr($api_key) . '"
data-api-secret="' . esc_attr($api_secret) . '"></script>';
});
This means you do not need to manually edit your theme's footer.php or add any code snippets. The plugin handles everything.
Post Improvement Suggestions
When users provide feedback about a specific WordPress post or page, the AI can suggest content improvements. These suggestions appear in the WordPress admin as a metabox on the post editing screen. You can review, approve, or dismiss each suggestion.
The improvement loop works as follows:
- User submits feedback via the widget while viewing a post
- The AI qualifies the feedback and identifies it as content-related
- FeedbackLoop AI sends an improvement suggestion to WordPress via webhook
- WordPress receives the suggestion and associates it with the correct post
- You review and approve (or dismiss) the suggestion in the post editor
The continuous improvement loop requires the WP Secret to be correctly configured in both the WordPress plugin settings and the FeedbackLoop AI tenant configuration. If suggestions are not appearing, verify the secret matches on both sides.
Troubleshooting
Magic Quotes Issue
WordPress automatically adds backslashes to all $_POST data via the wp_magic_quotes() function. This means json_decode($_POST['data']) will silently return null because the JSON string contains escaped quotes.
This is the most common cause of "webhook not working" issues. Always use wp_unslash() before json_decode() in any WordPress callback that processes JSON POST data.
The FeedbackLoop AI plugin handles this automatically, but if you are building custom integrations:
// WRONG - silently returns null due to magic quotes
$data = json_decode($_POST['payload'], true);
// CORRECT - strip magic quotes first
$data = json_decode(wp_unslash($_POST['payload']), true);
CORS Configuration
If the widget fails to load or shows CORS errors in the browser console, verify that your WordPress domain is in the tenant's allowedOrigins list.
# In the FeedbackLoop AI admin dashboard, set allowed origins:
allowedOrigins: https://yourwordpresssite.com, https://www.yourwordpresssite.com
Include both the www and non-www versions of your domain in the allowed origins list, unless you have a redirect in place.
Widget Not Loading
If the widget does not appear on your WordPress site:
- Check the browser console for JavaScript errors
- Verify the API URL is accessible from the browser (not just the server)
- Confirm the API key and secret are correct and match the tenant in FeedbackLoop AI
- Check for caching plugins (WP Super Cache, W3 Total Cache) that may serve a stale version without the widget script
- Ensure no security plugin (Wordfence, Sucuri) is blocking external script loading
Suggestions Not Appearing
If post improvement suggestions are not showing in the WordPress admin:
- Verify the
WP Secretmatches on both sides - Check that the FeedbackLoop AI server can reach your WordPress site (no firewall blocking incoming requests)
- Look at the FeedbackLoop AI logs for webhook dispatch errors:
pm2 logs feedbackloop-api - Verify the WordPress REST API is accessible:
https://yoursite.com/wp-json/
Mixed Content Errors
If your WordPress site uses HTTPS but the FeedbackLoop AI instance uses HTTP, browsers will block the widget script. Ensure your FeedbackLoop AI instance is served over HTTPS (the automated installer configures Caddy with automatic HTTPS via Let's Encrypt).