Skip to content

Conversation

@aristath
Copy link
Member

@aristath aristath commented Dec 10, 2025

Rewriting the plugin, from PHP + Vanilla-JS to React.

Playground link

@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2025

Test on Playground
Test this pull request on the Playground
or download the zip

@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2025

✅ Code Coverage Report

PHP Coverage (PHPUnit)

Metric Value
Current 52.72% 📊
Base 31.63%
Change 📈 21.09%

✅ PHP coverage meets threshold (40%)

JavaScript Coverage (Jest)

Metric Value
Current 38.80% 📉
Base 38.80%
Change 📈 0.00%

⚠️ Jest coverage below 40%


🎉 Great job maintaining/improving PHP coverage!

📊 File-level Coverage Changes (51 files)

🆕 New Files

Class Coverage Lines
🟢 Progress_Planner\Rest\Activities 100.00% 51/51
🟢 Progress_Planner\Rest\Badge_Stats 98.44% 63/64
🔴 Progress_Planner\Rest\Data_Collectors 26.03% 19/73
🔴 Progress_Planner\Rest\Email_Sending_Config 28.95% 11/38
🔴 Progress_Planner\Rest\Email_Test 37.31% 25/67
🟢 Progress_Planner\Rest\Page_Settings 83.33% 10/12
🔴 Progress_Planner\Rest\Plugin_Installer 27.97% 40/143
🔴 Progress_Planner\Rest\Popover_Actions 32.38% 34/105
🔴 Progress_Planner\Rest\Subscribe 51.76% 44/85
🔴 Progress_Planner\Rest\Task_Evaluation 41.57% 143/344
🔴 Progress_Planner\Rest\Timezone_Options 33.33% 12/36
🔴 Progress_Planner\Rest\Updates 13.33% 10/75
🔴 Progress_Planner\Rest\Upgrade_Tasks_Config 24.44% 11/45
🟢 Progress_Planner\Rest\Widgets\Activity_Scores 100.00% 147/147
🟢 Progress_Planner\Rest\Widgets\Content_Activity 98.61% 142/144
🟡 Progress_Planner\Rest\Widgets\Whats_New 73.22% 134/183
🔴 Progress_Planner\Rest\Wizard_Config 11.01% 12/109
🔴 Progress_Planner\Suggested_Tasks\Data_Collector\AIOSEO_Options 0.00% 0/37
🔴 Progress_Planner\Suggested_Tasks\Data_Collector\Old_Posts_For_Review 0.00% 0/63
🔴 Progress_Planner\Suggested_Tasks\Data_Collector\PHP_Version 0.00% 0/1
🔴 Progress_Planner\Suggested_Tasks\Data_Collector\Permalink_Has_Date 0.00% 0/7
🔴 Progress_Planner\Suggested_Tasks\Data_Collector\WP_Debug 0.00% 0/7
🔴 Progress_Planner\Suggested_Tasks\Data_Collector\Yoast_Options 0.00% 0/16
🔴 Progress_Planner\Suggested_Tasks\Data_Collector\Yoast_Premium_Status 0.00% 0/20
🔴 Progress_Planner\Utils\Plugin_Utils 0.00% 0/15

📈 Coverage Improved

Class Before After Change
Progress_Planner\Admin\Enqueue 0.43% 74.21% +73.78%
Progress_Planner\Admin\Page 31.29% 90.94% +59.65%
Progress_Planner\Activities\Suggested_Task 44.44% 83.33% +38.89%
Progress_Planner\Lessons 0.00% 35.14% +35.14%
Progress_Planner\Badges 66.10% 100.00% +33.90%
Progress_Planner\Rest\Recommendations_Controller 66.67% 100.00% +33.33%
Progress_Planner\Base 44.51% 61.24% +16.73%
Progress_Planner\Settings 42.11% 55.26% +13.15%
Progress_Planner\Page_Types 52.68% 62.95% +10.27%
Progress_Planner\Suggested_Tasks 5.22% 15.21% +9.99%
Progress_Planner\Goals\Goal_Recurring 91.49% 100.00% +8.51%
Progress_Planner\Admin\Page_Settings 38.71% 46.77% +8.06%
Progress_Planner\UI\Branding 33.33% 39.80% +6.47%
Progress_Planner\Plugin_Upgrade_Tasks 7.41% 11.32% +3.91%
Progress_Planner\UI\Chart 89.29% 92.86% +3.57%
Progress_Planner\Utils\Onboard 4.30% 7.53% +3.23%

📉 Coverage Decreased

Class Before After Change
Progress_Planner\Suggested_Tasks\Data_Collector\Inactive_Plugins 81.25% 0.00% -81.25%
Progress_Planner\Suggested_Tasks\Data_Collector\Post_Tag_Count 80.00% 0.00% -80.00%
Progress_Planner\Utils\System_Status 91.95% 83.44% -8.51%
Progress_Planner\Onboard_Wizard 56.40% 50.26% -6.14%
Progress_Planner\Update\Update_130 88.16% 84.42% -3.74%
Progress_Planner\Suggested_Tasks\Data_Collector\Data_Collector_Manager 64.29% 61.11% -3.18%
Progress_Planner\Admin\Editor 3.85% 2.22% -1.63%
Progress_Planner\Activities\Query 59.35% 58.41% -0.94%
Progress_Planner\Update\Update_190 71.77% 71.54% -0.23%
Progress_Planner\Utils\Plugin_Migration_Helpers 97.37% 97.22% -0.15%
ℹ️ About this report
  • PHP tests run with Xdebug coverage
  • Jest tests run with built-in coverage
  • Security tests excluded from PHP coverage
  • Coverage calculated from line coverage percentages

- Add REST API endpoints for data collectors and task evaluation
- Create React task registry system with TaskProvider base class
- Implement task injection service for React-registered tasks
- Create InteractiveTaskProvider base class for interactive tasks
- Migrate Hello_World task from PHP to React as proof of concept
- Remove Hello_World from PHP Tasks_Manager registration
- Integrate task injection into SuggestedTasks widget

This establishes the foundation for migrating all task providers from PHP to React while maintaining a thin REST API layer for data collection and WordPress operations.
- Add taskMigrationHelper.js with common patterns and data collector IDs
- Add TASK_MIGRATION.md guide for migrating PHP tasks to React
- Provides reference patterns and step-by-step migration instructions
- Create SamplePageTask.js React implementation
- Register task in task registry
- Remove from PHP Tasks_Manager registration

This follows the same pattern as Hello_World task migration.
- Create BlogDescriptionTask.js React implementation
- Use WordPress REST API settings endpoint to check if tagline is empty
- Register task in task registry
- Remove from PHP Tasks_Manager registration
…n, SEO Plugin, Remove Inactive Plugins, Permalink Structure)

- Create React implementations for 5 more tasks
- Register all tasks in task registry
- Remove from PHP Tasks_Manager registration

This continues the gradual migration pattern established with Hello_World and Sample_Page tasks.
- Remove duplicate Search_Engine_Visibility registration
- Task was already migrated to React in previous commit
- Convert all task providers from constructor-based config to static properties
- Update base classes (TaskProvider, InteractiveTaskProvider) to read from static properties
- Update task registry to accept classes instead of instances
- Update task injection service to support multi-task providers with getTasksToInject()
- Add isMultiTask static property and getTasksToInject() method for multi-task providers
- Remove singleton instances from all 30 task files
- Export classes directly instead of instances
- Update task registration to import and register classes
- Add support for target_taxonomy in getTaskId() for multi-task providers
- Fix nested ternary expression linting issue

This makes it easier to add new task providers by simply defining static properties without needing constructors.
- Update taskRegistry to listen for 'prpl.tasks.register' action
- Add task lifecycle handling: evaluate, check existence, create post, render
- Refactor SuggestedTasks widget to support streaming tasks
- Add sorted insertion by priority for streaming tasks
- Update BlogDescriptionTask to self-register as example
- Remove bulk task fetching, tasks now stream in as they register
@ilicfilip ilicfilip mentioned this pull request Dec 26, 2025
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants