Skip to content

WIP: Rewrite plugin in react#720

Draft
aristath wants to merge 366 commits intodevelopfrom
ari/reactify
Draft

WIP: Rewrite plugin in react#720
aristath wants to merge 366 commits intodevelopfrom
ari/reactify

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 53.03% 📊
Base 31.62%
Change 📈 21.41%

✅ PHP coverage meets threshold (40%)

JavaScript Coverage (Jest)

Metric Value
Current 49.70% 📊
Base 49.70%
Change 📈 0.00%

✅ Jest coverage meets threshold (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 10.00% 11/110
🔴 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.69% +74.26%
Progress_Planner\Admin\Page 31.71% 90.97% +59.26%
Progress_Planner\Activities\Suggested_Task 44.44% 83.33% +38.89%
Progress_Planner\Lessons 0.00% 36.84% +36.84%
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.02% +16.51%
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 34.55% 40.78% +6.23%
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\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 4.55% 2.44% -2.11%
Progress_Planner\Activities\Query 59.35% 58.41% -0.94%
Progress_Planner\Onboard_Wizard 56.40% 56.12% -0.28%
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 all step templates: welcome, whats-what, first-task, more-tasks, badges, email-frequency, settings, quit-confirmation
- Add form input templates: checkbox, radio
- Add task-specific templates: core-blogdescription, core-siteicon, select-locale, select-timezone

Note: PHPStan errors in badges.php are false positives - Badges\Monthly class exists but PHPStan can't detect it
…g CSS

- Apply progress_planner_dashboard_config filter to allow Onboard_Wizard to add wizard configuration
- Wizard config will be merged into prplDashboardConfig for React components
- Add onboarding.css from PR #714 (1352 lines)

Note: PHPStan errors in badges.php are false positives from original PR
- useOnboardingProgress: Save/restore wizard progress via AJAX
- useLicenseGenerator: Generate and save license keys during onboarding
- useTaskCompletion: Complete tasks during onboarding wizard
- Add useOnboardingWizard hook for state management
- Add OnboardingWizard main component with step rendering
- Add OnboardingStep base component with common functionality
- Add OnboardingNavigation and QuitConfirmation placeholders
- OnboardingNavigation: Left sidebar with step indicators
- QuitConfirmation: Dialog for confirming wizard exit
- WhatsWhatStep: Simple informational step
- BadgesStep: Badge system explanation with gauge component
- Privacy policy acceptance checkbox
- License generation for new users
- Auto-reload after license generation
- FirstTaskStep: Complete first onboarding task with form handling
- EmailFrequencyStep: Configure email frequency with conditional form fields
- SettingsStep: Configure homepage, about, contact, faq pages
- Post types selection
- Login destination redirect setting
- Internal navigation between sub-steps
- Save all settings at once via AJAX
- MoreTasksStep: 2 sub-steps (intro + task list)
- OnboardTask: Individual task component with form toggling
- Support for task completion and state management
- Add OnboardingWizard to Dashboard component
- Enqueue onboarding CSS
- Fix FirstTaskStep useEffect hook usage
- Auto-open wizard when appropriate
- Add missing __ import to BadgesStep
- Add sprintf import to SettingsStep
- Fix CSS enqueue to use wp_enqueue_style directly
- Fix wizard auto-open logic
- Add useTaskTemplate hook to fetch task-specific PHP templates
- Update OnboardTask to render task templates from PHP
- Convert tasks object to array for React in MoreTasksStep
- Handle form submission and file uploads in task templates
- Include rendered template HTML in task data from PHP
- Add AJAX endpoint to fetch task templates on demand
- Update OnboardTask to use template HTML from task data or fetch it
- Support for task-specific forms (blog description, site icon, etc.)
- Task templates are now included in task data from PHP
- OnboardTask fetches templates on demand if not provided
- Cleanup unused code
- Fix useEffect dependency warnings in FirstTaskStep, MoreTasksStep, SettingsStep
- Improve task form submission handling in OnboardTask
- Add file upload initialization for task templates
- Ensure form values are captured before task completion
- Add finished flag to wizard state to track completion
- Mark wizard as finished when user completes MoreTasksStep
- Save finished state to server before redirecting
- Prevent wizard from showing again after completion
- Add inline styles for popover positioning
- Remove automatic finish marking when reaching last step
- Only mark as finished when user explicitly finishes
- Keep finished flag check to prevent showing completed wizard
- Simplify privacy policy link rendering in WelcomeStep
- Use proper React JSX instead of string manipulation
- Improve accessibility and maintainability
- Include pages list in wizard config for page selection dropdowns
- Include post types list for post type selection checkboxes
- Populate SettingsStep dropdowns and checkboxes with data from PHP
- Add step click handling to navigation
- Improve SettingsStep save flow with delay before advancing
- Add custom onNext handler for MoreTasksStep to handle finishing
- Fix SettingsStep page title translations (Home page, About page, etc.)
- Fix React hooks dependency warning in OnboardingStep
- Fix JSDoc alignment
- Fix Prettier formatting issues
- Replace three dots with ellipsis character
- Fix nested ternary expression
- Add keyboard event handlers for accessibility
- Add proper role and tabIndex for interactive element
- Remove unused useOnboardingProgress import
- Remove unused progressHooks variable
- Simplify handleFinish to not duplicate progress saving logic
- Rename onBack prop to handleBack to avoid shadowing prevStep
- Add eslint-disable for useEffect dependency (task object is stable)
- Fix nested ternary by using separate conditional rendering
- Add keyboard event handlers for accessibility
- Fix unused variable warning in fileInputs forEach
- Fix missing closing tag
- Add keyboard event handlers for accessibility
- Add eslint-disable for useEffect dependency
- Fix unused variable in fileInputs forEach
- Fix ternary operator syntax error
- Add keyboard event handlers for accessibility
- Fix unused variable in fileInputs forEach
aristath and others added 30 commits February 4, 2026 14:50
Apply usePopoverSubmit hook, FormErrorMessage, and SubmitButton to
DisableCommentsPopover, YoastPopover, and AIOSEOPopover. Removes
duplicated useState/try-catch/finally patterns and identical JSX.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Apply usePopoverSubmit, FormErrorMessage, SubmitButton, and useWpSettings
to BlogDescriptionPopover, TimezonePopover, and SiteIconPopover. Settings
fetches now use cached useWpSettings/useApiData instead of raw apiFetch.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Apply usePopoverSubmit, FormErrorMessage, SubmitButton, useWpSettings,
and dashboardConfig (getAjaxUrl/getNonce) to DateFormatPopover,
PermalinkStructurePopover, and LocalePopover. Eliminates duplicated
window.progressPlanner access and submit boilerplate.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…popovers

Apply shared components to CustomPopover and SubscribeFormPopover.
Replace window.prplDashboardConfig access with getAjaxUrl()/getNonce().
Remove unused onSubmit prop from SubscribeFormPopover.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add jest mocks for @wordpress/html-entities and apiFetchCache service.
Add missing addAction/fetchDataCollector to hooks mocks across widget
and service tests. Fix OnboardingWizard tests to match actual component
behavior (no back button, CSS-class-based disabled state, correct
element queries). Fix popoverRegistry lazy component type check.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract 6 scattered SVG icons (arrow, trash, check, close, chevronDown,
warning) into a single Icon component with a path registry. Replace all
usages across TaskCheckbox, TaskPoints, ToggleSwitch, ConfirmDialog, and
TodoWidget. Delete the now-unused ArrowIcon and TrashIcon files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Create a self-contained React Tooltip component with click-to-open,
overlay dismiss, Escape key close, and ARIA attributes. Update all
4 consumers (TodoWidget, WidgetHeader, TaskActionInfo, TaskActionSnooze)
to use the new component. Remove the web component JS/CSS files and
their PHP enqueue calls. Remove the global overlay div and inline
script from admin-page.php.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move progressPlannerBadge localization from the web component script
handle to the dashboard script. Migrate .prpl-badge and
.prpl-previous-month-badge-progress-bars-wrapper styles to
monthly-badges.css. Delete the web component JS/CSS files and
remove the enqueue case from class-enqueue.php.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate InstallPluginButton styles to a co-located CSS file imported
by the React component. Delete the web component JS/CSS files, remove
the style enqueue from class-page.php, and delete the now-empty
assets/js/web-components/ and assets/css/web-components/ directories.
Update lint scripts to remove web-components glob pattern.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove the_chart() and render_chart() from class-chart.php. These
methods rendered web component chart elements and are no longer called.
Keep get_chart_data() and get_period_data() which are used by REST
endpoints.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove 10 PHP template files that are no longer rendered (React handles all
onboarding step UI). Remove template_file_name from step definitions and
the template field from the REST API response.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace PHP-rendered task templates (dangerouslySetInnerHTML) with native
React form components for blog description, site icon, timezone, and locale
tasks. Add locale-options REST endpoint. OnboardTask and FirstTaskStep now
use a task form registry to render React components with fallback to HTML.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace inline PHP/JS/CSS deactivation modal with a React component loaded
via a separate webpack entry point. The entry point uses its own runtime
(not shared with dashboard) since it runs on the plugins page. PHP now
renders a mount container and passes config via wp_localize_script.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move sessionStorage clearing from PHP inline script to dashboard.js entry
point and replace admin_footer inline CSS with wp_add_inline_style for menu
badge positioning.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The .prpl-badge grid layout and .prpl-previous-month-badge-progress-bars-wrapper
styles were in prpl-badge.css which was deleted in Commit 2. These styles are
still used by React Badge/BadgeGrid/MonthlyBadges components. Create badge.css
and import it in the Badge component so webpack bundles it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update suggested-task.css :has() selector to use .prpl-tooltip-visible class
instead of [data-tooltip-visible] attribute (removed with web component).
Remove duplicate badge.css since those styles already exist in
page-widgets/monthly-badges.css loaded via admin-page.php.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The webpack build produces CSS files for each widget entry point
(containing tooltip positioning/visibility from tooltip.css), but only
the scripts were being enqueued. Without the CSS, tooltips rendered
inline instead of as positioned overlays.

Also removes the dead prpl-badge dependency from suggested-tasks.css.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extracts the shared styling pattern (link-colored text, hover underline)
used by 5 action components into a single reusable component that renders
as either a <button> or <a> via the `as` prop.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…onClose props

Replace the ::after pseudo-element with a real <span> element so arrow
positioning can be overridden via inline styles. Add tooltipStyle,
arrowStyle, and onClose callback props to support consumer customization
and state cleanup on close.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…onstants

Replace duplicated styling in TaskActionComplete, TaskActionDelete,
TaskActionPopover, TaskActionLink, and TaskActionInfo with the new
TaskActionButton component. Add shared taskActionTooltipStyle and
taskActionArrowStyle constants to styles.js for tooltip positioning.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move all snooze duration picker styles from CSS to inline React styles.
Use the Tooltip onClose callback to reset isExpanded and hoveredLabel
state so reopening the tooltip shows a clean initial state.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace CSS :hover/:focus-within selectors with React state for action
visibility. Track isHovered and isFocused on TaskItem, pass visibility
and celebrating flags to TaskActions. Add separator spans between
actions, disabled checkbox styles during celebration, and pointer-events
guard to prevent interaction while celebrating.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All 240 lines of suggested-task.css have been migrated to inline React
styles or confirmed as dead code. Remove the CSS file and update
dependency headers in suggested-tasks.css and todo.css.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The renderAction function expects action.href for link-type actions,
but four task providers used url instead, causing links to fall back
to href='#'. Fix AIOSEOOrganizationLogoTask, YoastCornerstoneWorkoutTask,
YoastFixOrphanedContentTask, and YoastOrphanedContentWorkoutTask.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move CSS from tooltip.css into inline React styles on the Tooltip
component, TaskActions, TaskMoveButtons, and styles.js. Only 6 lines
remain in tooltip.css for the descendant p margin reset that cannot
be expressed as inline styles.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add info icon to the Icon component registry and use it directly in
WidgetHeader and TodoWidget. This eliminates the infoIconSvg prop
chain that was broken since the widget migration from PHP to React.

WidgetHeader now shows a tooltip with the built-in info icon whenever
tooltipContent is provided - no separate infoIconSvg prop needed.

Remove infoIconSvg from widgetRegistry, DashboardWidgets config
passthrough, and all widget registrations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

2 participants