Skip to content

Complete @TODOs#22966

Merged
vraja-pro merged 12 commits intofeature/task-list-phase-2from
1063-task-list-deal-with-the-remaining-todos-of-phase-2
Feb 17, 2026
Merged

Complete @TODOs#22966
vraja-pro merged 12 commits intofeature/task-list-phase-2from
1063-task-list-deal-with-the-remaining-todos-of-phase-2

Conversation

@leonidasmi
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi commented Feb 12, 2026

Context

  • Refactors some parts of phase-2's backend
    • Removes the Abstract_Completeable_Task abstract class, as per this, since it doesnt add any functionality
    • Adds a safeguard to ensure no child tasks will ever be included in the task collector - actually making sure we fail early by throwing an Incorrect_Child_Task_Usage_Exception exception
    • Abstract a lot of the task analyzer classes's functionalities introducing a Abstract_Task_Analyzer class. Will be proven useful whenever we add more types of analyzers.
    • Abstract a lot of the new class tasks' code into the Content_Score_Child_Task_Trait, to remove a lot of code duplication
    • Fixes the CI, by adding PHPCS fixes for the new sniffs

Summary

This PR can be summarized in the following changelog entry:

  • Complete @TODOs in the task-list feature branch.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Only regression tests:

  • Run the get_tasks GET request and confirm that you get the very same response with this PR and without (make sure you delete transients or wait a minute between requests)
    • there's one difference in the response: the parentTask attribute should now be named isParentTask.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • [] QA should use the same steps as above.
  • If you test this PR along with the other ones, you dont have to do anything, it adds nothing new, just refactors existing functionality. Special care only for the item in the impact check because it comes from the 1st phase of the task list.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

  • Have the llms.txt and Delete Hello World tasks incomplete and confirm that you can complete them via the tasks' modals.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.
  • This PR also affects Yoast SEO for Google Docs. I have added a changelog entry starting with [yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached the Google Docs Add-on label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.
  • I have run grunt build:images and commited the results, if my PR introduces new images or SVGs.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

@leonidasmi leonidasmi added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Feb 12, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Feb 12, 2026

Pull Request Test Coverage Report for Build 7dbdd5b30c2be320bd70990ef32b421f81e316d7

Details

  • 39 of 58 (67.24%) changed or added relevant lines in 13 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.6%) to 53.052%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/task-list/application/tasks/child-tasks/content-score-child-task-trait.php 19 21 90.48%
src/task-list/domain/exceptions/incorrect-child-trait-usage-exception.php 0 2 0.0%
src/task-list/infrastructure/indexables/recent-content-indexable-collector.php 2 4 50.0%
src/task-list/domain/exceptions/incorrect-child-task-usage-exception.php 0 5 0.0%
src/task-list/domain/components/abstract-task-analyzer.php 0 8 0.0%
Totals Coverage Status
Change from base Build 55dec9a111eaff1b7fe75cefc941ff84009561d0: -0.6%
Covered Lines: 32696
Relevant Lines: 61646

💛 - Coveralls

@leonidasmi leonidasmi added this to the feature/task-list-phase-2 milestone Feb 12, 2026
@leonidasmi leonidasmi marked this pull request as ready for review February 12, 2026 14:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes remaining TODO-driven refactors in the task-list feature (phase-2 backend), focusing on reducing duplication, tightening invariants around child-task usage, and aligning tests/PHPCS formatting with the updated implementation.

Changes:

  • Add a hard safeguard in Tasks_Collector to prevent passing Child_Task_Interface instances directly (throws Incorrect_Child_Task_Usage_Exception), with a matching unit test.
  • Introduce Abstract_Task_Analyzer and refactor Score_Task_Analyzer accordingly; extract shared child-task behavior into Content_Score_Child_Task_Trait.
  • Remove the no-op Abstract_Completeable_Task abstraction and drop the parentTask flag from parent task serialization; update affected unit tests and minor formatting/trailing-comma fixes.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Unit/Task_List/Infrastructure/Tasks_Collectors/Tasks_Collector_Parent_Tasks_Test.php Trailing-comma/array formatting updates for task collector parent/child behavior tests.
tests/Unit/Task_List/Infrastructure/Tasks_Collectors/Tasks_Collector_Constructor_Test.php Adds coverage ensuring constructor throws when given a child task.
tests/Unit/Task_List/Infrastructure/Indexables/Recent_Content_Indexable_Collector_Constructor_Test.php Formatting update (trailing comma).
tests/Unit/Task_List/Infrastructure/Indexables/Abstract_Recent_Content_Indexable_Collector_Test.php Formatting update (trailing comma).
tests/Unit/Task_List/Application/Tasks/Improve_Content_SEO_Child/Improve_Content_SEO_Child_To_Array_Test.php Formatting updates (trailing commas) for child task serialization tests.
tests/Unit/Task_List/Application/Tasks/Improve_Content_SEO_Child/Improve_Content_SEO_Child_Copy_Set_Test.php Formatting updates (trailing commas) for copy-set tests.
tests/Unit/Task_List/Application/Tasks/Improve_Content_SEO_Child/Improve_Content_SEO_Child_Constructor_Test.php Formatting update (trailing comma).
tests/Unit/Task_List/Application/Tasks/Improve_Content_SEO_Child/Abstract_Improve_Content_SEO_Child_Test.php Formatting updates (trailing commas) in setup/helpers.
tests/Unit/Task_List/Application/Tasks/Improve_Content_SEO/Improve_Content_SEO_To_Array_Test.php Updates expectations to match removal of parentTask flag.
tests/Unit/Task_List/Application/Tasks/Improve_Content_SEO/Improve_Content_SEO_Constructor_Test.php Formatting updates (trailing commas) in assertions.
tests/Unit/Task_List/Application/Tasks/Improve_Content_SEO/Abstract_Improve_Content_SEO_Test.php Formatting updates (trailing commas) in setup.
tests/Unit/Task_List/Application/Tasks/Improve_Content_Readability_Child/Improve_Content_Readability_Child_To_Array_Test.php Formatting updates (trailing commas) for child task serialization tests.
tests/Unit/Task_List/Application/Tasks/Improve_Content_Readability_Child/Improve_Content_Readability_Child_Copy_Set_Test.php Formatting updates (trailing commas) for copy-set tests.
tests/Unit/Task_List/Application/Tasks/Improve_Content_Readability_Child/Improve_Content_Readability_Child_Constructor_Test.php Formatting update (trailing comma).
tests/Unit/Task_List/Application/Tasks/Improve_Content_Readability_Child/Abstract_Improve_Content_Readability_Child_Test.php Formatting updates (trailing commas) in setup/helpers.
tests/Unit/Task_List/Application/Tasks/Improve_Content_Readability/Improve_Content_Readability_To_Array_Test.php Updates expectations to match removal of parentTask flag.
tests/Unit/Task_List/Application/Tasks/Improve_Content_Readability/Improve_Content_Readability_Constructor_Test.php Formatting updates (trailing comma).
tests/Unit/Task_List/Application/Tasks/Improve_Content_Readability/Abstract_Improve_Content_Readability_Test.php Formatting updates (trailing commas) in setup.
tests/Unit/Task_List/Application/Tasks/Child_Tasks/Content_Score_Child_Task_Trait_Constructor_Test.php New unit test validating the trait’s guard behavior.
tests/Unit/Task_List/Application/Score_Groups/SEO_Score_Groups/SEO_Score_Groups_Repository_Constructor_Test.php Formatting update (trailing comma).
tests/Unit/Task_List/Application/Score_Groups/SEO_Score_Groups/Abstract_SEO_Score_Groups_Repository_Test.php Formatting update (trailing comma).
tests/Unit/Task_List/Application/Score_Groups/Readability_Score_Groups/Readability_Score_Groups_Repository_Constructor_Test.php Formatting update (trailing comma).
tests/Unit/Task_List/Application/Score_Groups/Readability_Score_Groups/Abstract_Readability_Score_Groups_Repository_Test.php Formatting update (trailing comma).
src/task-list/infrastructure/tasks-collectors/tasks-collector.php Adds constructor-level guard to throw on direct child-task injection; keeps post-type task filtering.
src/task-list/infrastructure/register-post-type-tasks-integration.php Formatting update (trailing comma).
src/task-list/infrastructure/indexables/recent-content-indexable-collector.php Formatting updates (trailing commas) in method calls and data mapping.
src/task-list/domain/tasks/parent-task-trait.php Removes parentTask flag from serialized parent task output.
src/task-list/domain/tasks/abstract-completeable-task.php Deletes unused abstraction (no added behavior beyond interface marker).
src/task-list/domain/exceptions/incorrect-child-trait-usage-exception.php New exception used to enforce trait usage constraints.
src/task-list/domain/exceptions/incorrect-child-task-usage-exception.php New exception used when child tasks are passed directly to the collector.
src/task-list/domain/components/score-task-analyzer.php Refactors analyzer to extend Abstract_Task_Analyzer and inherit to_array().
src/task-list/domain/components/abstract-task-analyzer.php New shared analyzer base implementing to_array() for analyzers.
src/task-list/application/tasks/improve-content-seo.php Formatting updates and trailing commas; child task creation call formatting.
src/task-list/application/tasks/improve-content-readability.php Formatting updates and trailing commas; child task creation call formatting.
src/task-list/application/tasks/enable-llms-txt.php Switches from removed Abstract_Completeable_Task to Abstract_Task + interface implementation.
src/task-list/application/tasks/delete-hello-world.php Switches from removed Abstract_Completeable_Task to Abstract_Task + interface implementation.
src/task-list/application/tasks/complete-ftc.php Formatting update (trailing comma).
src/task-list/application/tasks/child-tasks/improve-content-seo-child.php Refactors child task to use shared Content_Score_Child_Task_Trait.
src/task-list/application/tasks/child-tasks/improve-content-readability-child.php Refactors child task to use shared Content_Score_Child_Task_Trait.
src/task-list/application/tasks/child-tasks/content-score-child-task-trait.php New trait centralizing shared content-score child-task behaviors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/task-list/domain/exceptions/incorrect-child-task-usage-exception.php Outdated
Copy link
Copy Markdown
Contributor

@vraja-pro vraja-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for the Copilot suggestion, I noticed you removed the property parentTask. But I had to use that propery eventually in the latest PR for Fix task list UX feedback. That was the way for me to know if a task is a parent task if there are no child tasks... and then display the message that there are no children. So Actually we do need that property, but maybe we can give it a better name that would indicate it's a boolean value, like : isParentTask

@leonidasmi
Copy link
Copy Markdown
Contributor Author

Also did the isParentTask suggestion @vraja-pro you probably need to update your open PR then

Copy link
Copy Markdown
Contributor

@vraja-pro vraja-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR & AC ✅

@vraja-pro vraja-pro merged commit 40a2f49 into feature/task-list-phase-2 Feb 17, 2026
26 checks passed
@vraja-pro vraja-pro deleted the 1063-task-list-deal-with-the-remaining-todos-of-phase-2 branch February 17, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants