Staging Comment Lab
WordPress staging plugin for controlled WooCommerce comment generation, approval, and publishing
by Staging Comment Lab · github.com/sinayavary/staging-comment-lab · website
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/sinayavary/staging-comment-lab/releases/download/v1.2.0/staging-comment-lab.zipControlled staging tool for generating WooCommerce customer accounts, product/article comment drafts, messenger approvals, scheduled publishing, and delayed admin replies.
Purpose
Automate a safe test workflow on non-production WordPress sites:
- Select products/posts with the fewest approved top-level comments
- Create test customer accounts
- Collect display names via Telegram/Bale
- Generate one AI (or template fallback) draft per account
- Approve/edit via wp-admin or messenger
- Publish inside configured hours
- Optionally schedule an admin reply
One generated account may publish exactly one top-level comment.
Environment restrictions
Writes require:
wp_get_environment_type() in {local, development, staging}
AND
SCL_TEST_MODE === true
If either fails, account generation, AI drafting, publishing, bot approval actions, and scheduled write jobs are blocked. Existing data remains viewable/removable.
Installation
See INSTALLATION.md in the workspace root, or:
- Copy this directory to
wp-content/plugins/staging-comment-lab - Add the constants below on a staging/local site
- Activate the plugin
Required wp-config.php example
define( 'WP_ENVIRONMENT_TYPE', 'staging' );
define( 'SCL_TEST_MODE', true );
define( 'SCL_WEBHOOK_SECRET', 'replace-with-long-random-secret' );
// Optional:
// define( 'SCL_AI_API_KEY', '...' );
// define( 'SCL_AI_ENDPOINT', '...' );
// define( 'SCL_TELEGRAM_BOT_TOKEN', '...' );
// define( 'SCL_BALE_BOT_TOKEN', '...' );
WooCommerce
Prefer WooCommerce customer creation (customer role). Without WooCommerce, WordPress users are created with the site default non-admin role and product features are limited.
AI configuration
OpenAI-compatible HTTP provider via wp_remote_post():
- Endpoint / API key from constants first, then options
- One request per draft (comment + reply suggestion + scores)
- One retry, then template fallback
- No embeddings/RAG/vector DB
Telegram / Bale
Enable providers in settings, set bot tokens (constants preferred), and authorize chat IDs.
Webhook routes:
/wp-json/staging-comment-lab/v1/webhook/telegram/{secret}
/wp-json/staging-comment-lab/v1/webhook/bale/{secret}
Daily workflow
Scheduler group: staging-comment-lab
Prefers Action Scheduler; falls back to WP-Cron.
Generation and publishing are separate jobs. The daily cycle never publishes.
Approval / naming / replies
- Naming: messenger asks for display name, confirms, then marks profile
ready - Draft approval: wp-admin or signed messenger callbacks
- Replies: modes
disabled,manual_approval,automatic_after_comment_approval
WP-CLI
wp scl status
wp scl run-cycle
wp scl account create
wp scl draft generate --content_id=123
wp scl drafts
wp scl cleanup --dry-run
wp scl cleanup --all --yes
wp scl verify
Cleanup & uninstall
Use Tools or wp scl cleanup (dry-run by default). Uninstall deletes data only when Delete plugin data on uninstall is enabled.
Security
See SECURITY_NOTES.md.
Development checks
php tools/verify.php
php tests/EnvironmentGuardTest.php
php tools/build-zip.phpReleases
1 release. Each count is every asset in that release; expand a row for the breakdown.