AI Recommendations - #701
Draft
ilicfilip wants to merge 26 commits into
Draft
Conversation
Co-authored-by: Sculptor <sculptor@imbue.com>
Co-authored-by: Sculptor <sculptor@imbue.com>
Co-authored-by: Sculptor <sculptor@imbue.com>
…t/plugins/progress-planner
…wp-content/plugins/progress-planner
Co-authored-by: Sculptor <sculptor@imbue.com>
Co-authored-by: Sculptor <sculptor@imbue.com>
Resolved conflicts in: - assets/js/recommendations/ai-task.js: Kept HEAD version with web component attribute approach - classes/suggested-tasks/providers/class-ai-tasks-from-server.php: Kept HEAD version with button and data attributes The agent branch implementation uses document.activeElement to identify which trigger button was clicked, allowing multiple AI tasks to share the same popover while maintaining correct task-specific data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Sculptor <sculptor@imbue.com>
Co-authored-by: Sculptor <sculptor@imbue.com>
Contributor
|
Test on Playground |
Contributor
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
unexpected_markdown_file | Unexpected markdown file "AI_TASKS_QUICK_START.md" detected in plugin root. Only specific markdown files are expected in production plugins. |
📁 AI_TASKS_IMPLEMENTATION.md (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
unexpected_markdown_file | Unexpected markdown file "AI_TASKS_IMPLEMENTATION.md" detected in plugin root. Only specific markdown files are expected in production plugins. |
📁 classes/suggested-tasks/providers/class-content-review.php (4 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
232 |
WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in | Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://docs.wpvip.com/databases/optimize-queries/using-post__not_in/ for more information. |
377 |
WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in | Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://docs.wpvip.com/databases/optimize-queries/using-post__not_in/ for more information. |
381 |
WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in | Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://docs.wpvip.com/databases/optimize-queries/using-post__not_in/ for more information. |
388 |
WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in | Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://docs.wpvip.com/databases/optimize-queries/using-post__not_in/ for more information. |
📁 classes/suggested-tasks/data-collector/class-unpublished-content.php (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
103 |
WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in | Using exclusionary parameters, like post__not_in, in calls to get_posts() should be done with caution, see https://docs.wpvip.com/databases/optimize-queries/using-post__not_in/ for more information. |
📁 classes/suggested-tasks/data-collector/class-yoast-orphaned-content.php (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
111 |
PluginCheck.Security.DirectDB.UnescapedDBParameter | Unescaped parameter $query used in $wpdb->get_row()\n$query assigned unsafely at line 98. |
📁 classes/suggested-tasks/data-collector/class-terms-without-description.php (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
108 |
PluginCheck.Security.DirectDB.UnescapedDBParameter | Unescaped parameter $query used in $wpdb->get_results()\n$query assigned unsafely at line 106. |
📁 classes/suggested-tasks/data-collector/class-terms-without-posts.php (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
120 |
PluginCheck.Security.DirectDB.UnescapedDBParameter | Unescaped parameter $query used in $wpdb->get_results()\n$query assigned unsafely at line 118. |
📁 classes/activities/class-query.php (2 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
71 |
PluginCheck.Security.DirectDB.UnescapedDBParameter | Unescaped parameter $table_name used in $wpdb->query()\n$table_name assigned unsafely at line 58. |
163 |
PluginCheck.Security.DirectDB.UnescapedDBParameter | Unescaped parameter $where_args used in $wpdb->get_results()\n$where_args assigned unsafely at line 153. |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
One conflict, in classes/class-base.php: develop removed the Onboard_Wizard @method annotation along with the class itself (the onboarding revert), while this branch added get_ai_tasks() on the adjacent line. Resolved by keeping get_ai_tasks() and dropping get_onboard_wizard(), since Progress_Planner\Onboard_Wizard no longer exists on develop. classes/class-suggested-tasks.php and classes/suggested-tasks/class-tasks-manager.php auto-merged; verified both sides survived — this branch's three prpl_ai_* REST meta fields and the AI_Tasks_From_Server registration, alongside develop's rest_sanitize_recommendation XSS filter and the progress_planner_task_activity_category filter.
The two new AI classes shipped with no coverage, which dropped overall coverage by 0.78% and failed the Code Coverage Check gate (threshold -0.5%). AI_Tasks (9 tests): the get_items() failure paths -- transport error, non-200 status, non-JSON body -- each return an empty array rather than propagating an error, plus the caching behaviour, that a different branding uses a separate cache entry, and the per-task response cache/clear round-trip. AI_Tasks_From_Server (10 tests): the AJAX entry point's capability check, nonce check and required task_id, the cached-response short-circuit (asserting no HTTP call is made), the missing-license-key path (likewise no HTTP call), a server error surfacing the server's message without caching it, a successful execution being cached, and task injection -- including that re-running injection does not duplicate an existing task and that a task without a title falls back to the default. Verified by mutation: removing the capability check, the nonce check, the license-key guard, the non-200 status check, the JSON-decode check or the cache short-circuit each fail at least one test. Two notes on what is deliberately not asserted. The non-200 test uses a valid-JSON body, because a non-JSON body would be caught by the decode check instead and would not exercise the status guard. And the is_wp_error() branch in get_items() is not separately pinned: with it removed, wp_remote_retrieve_response_code() returns '' for a WP_Error, so the status check already returns the same empty array. That branch only changes which message is logged.
Contributor
✅ Code Coverage Report
🎉 Great job maintaining/improving code coverage! 📊 File-level Coverage Changes (6 files)🆕 New Files
📈 Coverage Improved
📉 Coverage Decreased
ℹ️ About this report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Client part of the https://github.com/ProgressPlanner/progress-planner-server/pull/51