Generate comprehensive BuddyPress test data for development and testing.
Author: vapvarun
Website: Wbcom Designs
GitHub: vapvarun/buddypress-playground-cli
# Generate a complete test community with one command
wp bp playground scenario generate small_community --clean --yes
# That's it! You now have:
# ✓ 50 users with complete profiles and member types
# ✓ XProfile fields and data
# ✓ Friend connections
# ✓ 10 groups with members
# ✓ Private message threads
# ✓ 200+ activities with comments and favorites
# ✓ BBPress forums, topics, and replies (if BBPress is active)- 7 Complete Modules: Users, XProfile, Friends, Groups, Messages, Activities, BBPress
- Smart Data Generation: Realistic names, profiles, and content
- Member Types: Students, Professionals, Teachers, Alumni, Moderators
- Group Types: Community, Project, Course, Team, Support
- Proper Sequencing: Data created in correct dependency order
- Predefined Scenarios: From minimal (10 users) to large (5000 users)
- Batch Processing: Efficient handling of large datasets
- Full WP-CLI Integration: Complete command-line control
- WordPress 5.0+
- BuddyPress 12.0+
- PHP 7.4+
- WP-CLI
- Optional: BBPress for forum generation
# Clone or download to plugins directory
cd wp-content/plugins/
git clone https://github.com/vapvarun/buddypress-playground-cli.git
# Activate the plugin
wp plugin activate buddypress-playground-cli| Scenario | Users | Groups | Activities | Description |
|---|---|---|---|---|
minimal |
10 | 3 | 50 | Quick testing setup |
small_community |
50 | 10 | 200 | Development environment |
development |
100 | 15 | 500 | Balanced dataset |
educational |
300 | 30 | 1000 | LMS/Educational platform |
professional |
200 | 25 | 800 | Professional networking |
medium_community |
500 | 50 | 2000 | Staging environment |
large_community |
5000 | 200 | 10000 | Performance testing |
# List all available scenarios
wp bp playground scenario list
# View details about a specific scenario
wp bp playground scenario info small_community
# Preview what will be generated (dry run)
wp bp playground scenario generate medium_community --dry-run# Generate with default settings
wp bp playground scenario generate small_community
# Clean existing data first (recommended)
wp bp playground scenario generate development --clean
# Skip confirmation prompts (for scripts/automation)
wp bp playground scenario generate minimal --yes
# Skip specific phases if needed
wp bp playground scenario generate professional --skip-phases=forums,messages# Simple: Generate 100 users
wp bp playground users --count=100
# With options
wp bp playground users --count=50 --with-avatar --with-cover# Create XProfile structure and populate data
wp eval "
require_once WP_PLUGIN_DIR . '/buddypress-playground-cli/includes/functions-bp-playground-xprofile.php';
// Register member types
bp_playground_register_member_types();
// Create field groups and fields
bp_playground_create_xprofile_structure();
// Populate for all users
$users = get_users(['fields' => 'ID']);
bp_playground_populate_xprofile($users, true);
"# Generate friendships between users
wp eval "
$friends = bp_playground_get_module('friends');
$friends->generate([
'friendship_patterns' => true,
'mutual_friendships' => true,
'friendship_distribution' => 'natural',
'acceptance_rate' => 85,
'batch_size' => 50
]);
"# Simple: Generate 20 groups
wp bp playground groups --count=20
# With member range
wp bp playground groups --count=10 --min-members=5 --max-members=25# Generate friendships with default 10% network density
wp bp playground friends
# Higher density (more connections)
wp bp playground friends --density=0.2
# With specific pending rate
wp bp playground friends --density=0.15 --pending-rate=0.1
# No pending requests
wp bp playground friends --no-pending# Simple: Generate 50 message threads
wp bp playground messages --count=50
# With message range per thread
wp bp playground messages --count=100 --min-messages=2 --max-messages=15
# Within specific timeframe
wp bp playground messages --count=200 --timeframe=30# Simple: Generate 200 activities
wp bp playground activities --count=200
# With engagement (comments, favorites)
wp bp playground activities --count=100 --with-comments --with-favorites# Simple: Generate 5 forums with topics and replies
wp bp playground forums
# Custom counts
wp bp playground forums --forums=10 --topics=20 --replies=10
# Without topic tags
wp bp playground forums --forums=3 --no-tags# List registered member types
wp bp playground member-types list
# Register default member types (student, teacher, professional, alumni, moderator)
wp bp playground member-types register
# Assign member types randomly to all users
wp bp playground member-types assign --random --all
# Assign specific type to specific users
wp bp playground member-types assign --type=student --user-ids=5,6,7
# Overwrite existing assignments
wp bp playground member-types assign --random --all --overwrite
# View member type statistics
wp bp playground member-types stats# List registered group types
wp bp playground group-types list
# Register default group types (community, project, course, team, support)
wp bp playground group-types register
# Assign group types randomly to all groups
wp bp playground group-types assign --random --all
# Assign specific type to specific groups
wp bp playground group-types assign --type=course --group-ids=5,6,7
# Overwrite existing assignments
wp bp playground group-types assign --random --all --overwrite
# View group type statistics
wp bp playground group-types stats# Display plugin and BuddyPress system info
wp bp playground info
# Output as JSON
wp bp playground info --format=json# View current data statistics
wp bp playground stats
# Detailed stats per component
wp bp playground stats --detailed# Check data integrity
wp bp playground verify
# Check and auto-fix issues
wp bp playground verify --fix
# Check relationship integrity
wp bp playground verify --relationships# Preview what would be cleaned (dry run)
wp bp playground cleanup --dry-run
# Clean all generated data
wp bp playground cleanup --force
# Clean specific component
wp bp playground cleanup activities
# Clean data older than 30 days
wp bp playground cleanup --older-than=30The plugin follows this sequence to ensure proper data relationships:
- Users - Create user accounts with proper roles
- XProfile Structure - Set up field groups and fields
- XProfile Data - Populate user profiles and assign member types
- Friends - Create friendship connections
- Groups - Create groups and add members
- Messages - Generate private message threads
- Activities - Create activity stream (uses existing groups/friends)
- BBPress - Generate forums, topics, and replies
The plugin creates comprehensive XProfile field groups:
- Base Group: Name (auto-populated from user data)
- Personal Info: Birthday, Gender, About Me, Location
- Education & Work: Company, Job Title, Education Level, Field of Study
- Interests: Hobbies, Favorite Books, Movies, Music
- Contact: Phone, Website, Address
- Social Media: Twitter, LinkedIn, Facebook, Instagram
- Preferences: Newsletter subscription, Privacy settings
Four member types are automatically created and distributed:
- Students (40%)
- Professionals (30%)
- Alumni (20%)
- Teachers/Instructors (10%)
# The plugin auto-sets memory to 1024M, but for very large datasets:
WP_CLI_PHP_ARGS="-d memory_limit=2048M" wp bp playground scenario generate large_community# For large communities, run in background
nohup wp bp playground scenario generate large_community --clean &
# Monitor progress
tail -f nohup.out# Start small and build up
wp bp playground scenario generate minimal
wp bp playground users generate 50
wp bp playground groups generate 10
wp bp playground activities generate 200# Remove all BuddyPress data (keeps WordPress users)
wp bp playground scenario generate minimal --clean
# Or clean specific components
wp eval "
global \$wpdb;
// Clean activities
BP_Activity_Activity::delete(['type' => null]);
// Clean messages
\$wpdb->query('TRUNCATE TABLE ' . \$wpdb->base_prefix . 'bp_messages_messages');
// Clean groups
\$wpdb->query('DELETE FROM ' . \$wpdb->base_prefix . 'bp_groups');
"- Memory errors: Increase PHP memory limit
- Timeout errors: Use smaller batches or run in background
- Missing data: Ensure BuddyPress components are active
- BBPress warnings: Non-critical, related to textdomain loading
# Enable WordPress debug
wp config set WP_DEBUG true
wp config set WP_DEBUG_LOG true
# Check logs
tail -f wp-content/debug.logAll modules have been tested and optimized:
- ✅ Users Module - Fully functional
- ✅ XProfile Module - Includes member types
- ✅ Friends Module - Fixed array boundary issues
- ✅ Groups Module - Fixed table name issues
- ✅ Messages Module - Fixed timestamp generation
- ✅ Activities Module - Fixed deprecated functions
- ✅ BBPress Module - Fixed undefined keys
Report issues or contribute at: https://github.com/vapvarun/buddypress-playground-cli
GPL v2 or later
Developed by Wbcom Designs for the BuddyPress community.