A WordPress module for managing personalized next steps for users after completing the onboarding flow. This module provides contextual tasks and guidance based on the user's site type (personal blog, business, or ecommerce).
- Provides personalized next steps based on site type (personal blog, business/corporate, ecommerce)
- Integrates with onboarding module to automatically load appropriate task sets when
nfd_module_onboarding_site_info
is updated - Intelligently detects site type for existing installations using plugin analysis, content detection, and site characteristics
- Displays next steps via dashboard widget and dedicated portal interface
- Manages task completion state and progress tracking across multiple tracks and sections
- Exposes hooks and API for other modules to integrate with next steps functionality
- Provides plan switching capabilities when site type changes post-onboarding
- Maintains task persistence through WordPress options API for reliable state management
- Supports three distinct plan types with contextually relevant tasks:
- Personal/Blog: Content creation, SEO basics, social sharing
- Business/Corporate: Professional features, team collaboration, lead generation
- Ecommerce: Store setup, payment processing, product management, shipping configuration
- When a user completes onboarding and selects a site type, the appropriate next steps plan should be automatically loaded and available in the dashboard widget and plugin app.
- For existing sites without onboarding data, the module should detect site characteristics and load the most appropriate plan without user intervention.
- Task completion and progress should persist across page loads and remain accurate when users return to the dashboard.
- The dashboard widget should display current progress and provide clear calls-to-action for incomplete tasks and link users to the appropriate page to complete the task.
- Smart Site Detection: Automatically detects site type for existing installations based on plugins, content, and configuration
- Dynamic Plan Loading: Loads appropriate next steps based on onboarding choices or detected site characteristics
- Multiple Site Types: Supports personal/blog, business/corporate, and ecommerce site types
- Task Management: Track completion status of individual tasks and sections
- Dashboard Widget: Integrated WordPress dashboard widget
- Standalone Portal: Full-page next steps interface
composer config repositories.newfold composer https://newfold-labs.github.io/satis
composer require newfold-labs/wp-module-next-steps
// Include in your plugin's bootstrap
use NewfoldLabs\WP\Module\NextSteps\NextSteps;
// Initialize the module
$next_steps = new NextSteps();
The module integrates with onboarding flows by listening for site type changes:
// The module automatically hooks into this option
update_option('nfd_module_onboarding_site_info', [
'site_type' => 'personal', // 'personal', 'business', or 'ecommerce'
// ... other onboarding data
]);
PlanManager
: Manages plan loading, switching, and task updatesPlanLoader
: Handles initial setup and dynamic plan switchingStepsApi
: WordPress option-based data persistence- DTOs: Strongly-typed data objects (
Plan
,Track
,Section
,Task
)
For existing sites without onboarding data, the module includes intelligent detection:
- Ecommerce: Detects WooCommerce, product post types, other ecommerce plugins
- Business: Analyzes user count, business pages, professional plugins, site naming
- Personal: Default fallback for simple sites
- PHP 7.3+
- Composer
- WordPress test environment (optional, for full integration tests)
Install development dependencies:
composer install
# Run all tests
composer test
# Run tests with coverage report
composer test-coverage
# Generate HTML coverage report
composer test-coverage-html
The test suite includes:
- Unit Tests:
tests/phpunit/
PlanManagerTest.php
- Tests plan loading, switching, and task management (21 tests)PlanLoaderTest.php
- Tests site detection and dynamic loading (19 tests)
Tests run in a lightweight WordPress environment with:
- Mock WordPress functions (
get_option
,update_option
, etc.) - Isolated test state (cleaned between tests)
- Fallback support for environments without full WordPress setup
<?php
use NewfoldLabs\WP\Module\NextSteps\PlanManager;
class MyTest extends WP_UnitTestCase {
public function setUp(): void {
parent::setUp();
// Clean options before each test
delete_option(PlanManager::OPTION);
delete_option(PlanManager::SOLUTION_OPTION);
}
public function test_my_feature() {
// Your test code here
$result = PlanManager::get_current_plan();
$this->assertNotNull($result);
}
}
- WordPress test environment running
- Cypress installed in parent project
# From the plugin root directory
npx cypress run --spec "vendor/newfold-labs/wp-module-next-steps/tests/cypress/integration/next-steps-widget.cy.js"
npx cypress run --spec "vendor/newfold-labs/wp-module-next-steps/tests/cypress/integration/next-steps-portal.cy.js"
- Widget Tests: Tests dashboard widget functionality, interactions, and state management
- Portal Tests: Tests full-page portal interface and navigation
- Clean State: Each test starts with a clean slate using
wpCli('option delete nfd_next_steps')
- Combined Test Blocks: Optimized for speed by reducing login operations
- Real User Interactions: Tests actual user workflows and task completion
# Run PHP Code Sniffer
composer lint
# Auto-fix coding standards issues
composer fix
# Run CI-matching standards (stricter)
./lint-ci.sh
The module follows WordPress coding standards with Newfold-specific extensions.
Tests run automatically on:
- Pull requests
- Pushes to main branches
- Manual triggers
CI includes:
- PHPUnit tests
- Cypress E2E tests
- Code quality checks
- WordPress compatibility testing
Run the Newfold Prepare Release
github action to automatically bump the version (either patch, minor or major version), and update build and language files all at once. It will create a PR with changed files for review.
- This module has a constant
NEXT_STEPS_VERSION
which needs to be incremented in conjunction with new releases and updates via github tagging. - Update the version in the
composer.json
file. - Update build files and/or language files to reflect new version.
- Create release branch and release PR.
- After merge, create a new release with proper semantic versioning.
// Get current active plan
$plan = PlanManager::get_current_plan();
// Switch to different plan type
$plan = PlanManager::switch_plan('ecommerce');
// Update task status
PlanManager::update_task_status('track_id', 'section_id', 'task_id', 'done');
// Get plan statistics
$stats = PlanManager::get_plan_stats();
// Manually trigger site type detection
$detected_type = PlanLoader::detect_site_type();
// Load default steps (usually automatic)
PlanLoader::load_default_steps();
The module maps onboarding site types to internal plan types:
const PLAN_TYPES = [
'personal' => 'blog', // Personal sites → Blog plan
'business' => 'corporate', // Business sites → Corporate plan
'ecommerce' => 'ecommerce', // Ecommerce sites → Ecommerce plan
];
nfd_next_steps
: Stores current plan and task statesnfd_next_steps_solution
: Stores current solution typenfd_module_onboarding_site_info
: Integration point for onboarding data
- Fork the repository
- Create a feature branch
- Write tests for new functionality
- Ensure all tests pass:
composer test
- Follow coding standards:
composer lint
- Submit a pull request
# Install dependencies
composer install
# Run tests during development
composer test
# Check code quality
composer lint
# Auto-fix simple issues
composer fix
# Run full CI simulation
./lint-ci.sh && composer test
GPL-3.0-or-later
For issues and feature requests, please use the GitHub issue tracker.