Show HN: WordPress plugin that lets readers fix your articles (via AI prompts)

2 hours ago 1

Post Digest Banner

Transform passive readers into engaged users with customizable AI summary buttons.

WordPress Plugin PHP Version License GDPR Compliant


🎯 What Does Post Digest Do?

Post Digest adds interactive "Summarize with ChatGPT" buttons to your WordPress posts. But here's what makes it special: readers can customize the AI prompt right on your page before clicking. This gives you invaluable insights into what your audience actually cares about!

Traditional analytics tell you what people read. Post Digest tells you what questions they're asking about your content. See which topics spark curiosity, what pain points need addressing, and how readers want information presented.


Step 1: Add the Block in Gutenberg Editor

Adding the Post Digest block in Gutenberg

Simply search for "Post Digest" in the block inserter. The block integrates seamlessly with WordPress's native editor experience.


Step 2: Customize the Prompt Template (Author View)

Customizing prompt instructions in the block editor

As the author, you set the default instructions for ChatGPT. Want bullet points? A technical summary? Explain it for beginners? You control the template. The preview shows exactly how the button will appear on your published post.

What you see:

  • ✅ Real-time preview of the prompt
  • ✅ Live URL generation as you type
  • ✅ Clean, intuitive interface

Step 3: Interactive Reader Experience (Frontend)

Frontend view showing editable prompt interface

This is what your readers see - an elegant, editable prompt interface. They can:

  • ✏️ Customize the instructions to their specific needs
  • 🎯 Ask specific questions about your content
  • 🚀 Click once to get AI-powered insights

Example: A reader might change "give me a summary" to "explain this for a 12-year-old" or "focus on the technical implementation details."

This customization data is GOLD - it reveals exactly what information gaps exist in your content!


Step 4: Seamless ChatGPT Integration

ChatGPT interface with pre-filled prompt

One click and boom! ChatGPT opens with the fully customized prompt pre-filled. Your reader gets instant, AI-powered insights about your post.

The prompt includes:

  • 📄 Your post title
  • 🔗 Full URL to the article
  • ✨ Customized instructions (either yours or reader-modified)

Step 5: Analytics Dashboard (WordPress Comments)

Track engagement in the WordPress Comments section:

  • 📊 See all button clicks grouped by post
  • 💡 Discover which prompt variations readers prefer
  • 🎯 Identify content gaps and reader questions
  • 🔒 All data anonymized for GDPR compliance

Example insights:

  • "15 readers asked to explain this 'for beginners'" → Time to simplify!
  • "8 readers wanted 'technical details only'" → Maybe add an advanced section?
  • "Readers keep asking about X" → Create a dedicated post about X!

How to view: In WordPress admin, go to Comments → Filter by comment type.


🛡️ Enterprise-Grade Security

  • SQL Injection Protection - All database queries use prepared statements
  • CSRF Prevention - Comprehensive nonce verification
  • Input Validation - Multi-layer validation on client and server
  • XSS Protection - All output properly escaped
  • Rate Limiting - Prevents abuse (10 requests/minute per IP)
  • IP Anonymization - Automatic IPv4/IPv6 anonymization
  • No External Tracking - All data stored locally in WordPress
  • Data Minimization - Only essential data collected
  • Transparent - Users know exactly what's tracked
  • Secure Storage - All data sanitized before database storage
  • WordPress Coding Standards - 100% compliant
  • Unique Prefixing - wrpdig_ namespace prevents conflicts
  • Clean Uninstall - Complete data removal option
  • Theme Compatible - Prefixed CSS prevents style conflicts
  • Translation Ready - Complete i18n support

Built-in translations for:

  • 🇩🇪 German (Deutsch)
  • 🇬🇧 English
  • 🇪🇸 Spanish (Español)
  • 🇫🇷 French (Français)

Option 1: WordPress.org (After Approval)

  1. Log into WordPress admin
  2. Go to Plugins → Add New
  3. Search "Post Digest"
  4. Click Install → Activate
  1. Download the latest release from dist/ folder
  2. Go to Plugins → Add New → Upload Plugin
  3. Choose the .zip file
  4. Click Install Now → Activate

Option 3: Developer Installation

cd wp-content/plugins/ git clone [email protected]:atraining/post-digest.git # Activate via WordPress admin

1. Create or edit a post

  • Open any post in the Gutenberg editor

2. Add the block

  • Click the (+) button
  • Search "Post Digest"
  • Add the block

3. Customize (optional)

  • Edit the default prompt instructions
  • Preview how it will look
  • Publish!

4. Monitor engagement

  • Check WordPress Comments
  • Filter by comment type to see analytics
  • Identify content opportunities

Block Registration:

// The block is registered with namespace: wrpdig/summary-button register_block_type('wrpdig/summary-button', array( 'render_callback' => array('WrpDig_Block', 'render_callback') ));

AJAX Endpoint:

// Track button clicks action: 'wrpdig_track_click' nonce: wrpdigData.nonce post_id: [current_post_id]

🔧 Technical Specifications

  • WordPress: 5.0+ (Gutenberg required)
  • PHP: 7.4+ (tested up to 8.2)
  • JavaScript: ES6+ browser support
  • Database: Standard WordPress tables (no custom tables)
  • Database Queries: Optimized with prepared statements
  • Caching: Transient-based rate limiting
  • Assets: Minimal JS/CSS loaded only when block is present
  • Server-Side Rendering: Better SEO and performance
  • ✅ Chrome 90+
  • ✅ Firefox 88+
  • ✅ Safari 14+
  • ✅ Edge 90+
  • ⚠️ Graceful degradation for older browsers

  • ✅ Button clicks
  • ✅ Prompt modifications (what readers changed)
  • ✅ Timestamp of interaction
  • ✅ Anonymized IP (GDPR compliant)
  • ✅ Post ID and title
  • ❌ Full IP addresses
  • ❌ Personal information
  • ❌ ChatGPT responses
  • ❌ External analytics services
// Get analytics for a specific post (if developing) $analytics = WrpDig_Analytics::get_analytics_for_post($post_id); // Or view in WordPress admin: // Comments → Filter by comment type

Security Measures Implemented

1. Input Validation

// All inputs validated $post_id = intval($_POST['post_id']); $prompt = sanitize_textarea_field($_POST['prompt']); if (strlen($prompt) > 5000) wp_send_json_error();

2. CSRF Protection

wp_verify_nonce($nonce, 'wrpdig_track_click');

3. Rate Limiting

// 10 requests per minute per IP set_transient('wrpdig_rate_limit_' . $ip_hash, $count, MINUTE_IN_SECONDS);

4. IP Anonymization (GDPR)

// IPv4: 192.168.1.123 → 192.168.1.0 // IPv6: Last 80 bits set to 0
  • ✅ Unique prefix: wrpdig_ (6 characters)
  • ✅ No generic function names
  • ✅ Proper file naming: post-digest.php
  • ✅ Assets excluded from plugin package
  • ✅ All code follows WordPress standards

🎯 WordPress.org Compliance Release

  • Breaking Change: Prefix changed from post_digest to wrpdig
  • ✅ Renamed main file to post-digest.php
  • ✅ Updated 74+ namespace instances
  • ✅ Assets properly excluded from distribution
  • ✅ All PHP files validated for syntax
  • ⚠️ Migration Note: Clean install recommended for existing users

🛡️ Security & Privacy Update

  • Added SQL injection protection
  • Implemented GDPR-compliant IP anonymization
  • Enhanced input validation
  • Improved error handling
  • Performance optimizations
  • Initial release
  • Basic Gutenberg block
  • ChatGPT integration
  • Simple analytics

We welcome contributions!

  • Use GitHub Issues
  • Include WordPress/PHP versions
  • Provide steps to reproduce
  1. Fork the repository
  2. Create a feature branch
  3. Follow WordPress coding standards
  4. Submit PR with clear description

Help translate Post Digest:

  • Translation files in /languages/
  • Use Poedit or similar tool
  • Submit translations via PR

post-digest/ ├── post-digest.php # Main plugin file ├── readme.txt # WordPress.org readme ├── uninstall.php # Cleanup on uninstall ├── includes/ │ ├── class-wrpdig-analytics.php │ └── class-wrpdig-block.php ├── blocks/ │ └── summary-button/ │ ├── edit.js # Block editor │ ├── frontend.js # Frontend interaction │ └── style.css # Styling ├── languages/ # Translation files ├── assets/ # WordPress.org assets (not in plugin zip) │ ├── banner-1544x500.png │ ├── screenshot-1.png │ ├── screenshot-2.png │ ├── screenshot-3.png │ └── screenshot-4.png └── dist/ # Distribution packages


GPL v2 or later

Post Digest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


Developed by: Wise Relations

Contributors:

  • Security review and enhancements
  • GDPR compliance implementation
  • WordPress.org submission preparation

If you find Post Digest useful:

  • ⭐ Star this repository
  • 🐛 Report bugs to help improve
  • 🔄 Share with others who might benefit

Made with ❤️ for the WordPress community

Read Entire Article