Repository navigation
Conversation
The streak and content widgets now show progress in weeks and posts instead of a percentage, towards the next badge. The info icon and the "Show all badges" link are replaced by "How can I collect these badges?", which opens a popover for that widget: a track from zero to the last badge, each badge with what it takes, and on hover how many weeks or posts are left. The streak popover also shows the streak freeze, and when it was used. To tell whether the freeze was used, the streak calculation now reports it. It also counted breaks on the cached goal object, so a second call in the same request could return a different streak; it now works on a copy. The current week is still running, so a week without activity so far no longer uses the freeze or breaks the streak. The old combined streak popover is removed, and the monthly popover no longer lists the content and streak badges. Plugins that add badge groups to it (pp-hosts' onboarding badges) still can. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plugin readme previewOpen preview · Commit 35 passed · 0 warnings · 2 notes Notes (2)
Passed checks (35)
Readme and PHP-header checks only; this does not test plugin runtime compatibility. |
|
Test on Playground |
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 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/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/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. |
📁 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. |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
✅ Code Coverage Report
📊 File-level Coverage Changes (3 files)🆕 New Files
📈 Coverage Improved
📉 Coverage Decreased
ℹ️ About this report
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Streak badges keep their saved progress for up to two days, while the track used the streak worked out just now, so the bar could stand on a badge the card still called "1 week to go". Earned and weeks-to-go for streak badges now come from the same live streak. - The streak freeze is one break for the whole history. get_streak() now reports where it falls only when it is part of the best streak (the one the bar shows), so the snowflake is not placed on the wrong streak. - get_streak() and get_track() remember their result for the request; the widget and its popover share it. - Each badge class has a TARGET constant (Content Curator also TARGET_EXISTING) and get_target(), instead of the numbers being written out again in the widget class. The badge maths uses the constants; the Content Curator percentage for existing posts is unchanged. - get_track() takes no argument; each widget knows its own context. - The popover template keeps the streak and content texts in one list, and texts with a number use _n() so every language gets the right plural. - The wobble is one shared rule for "in progress" and "to go" badges, and "N to go" also shows on focus, so a tap on a touch screen reveals it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review pass: what changed and whyRe-checked against pro#190, Mijke's comment there ("size and padding consistent with #191") and the Figma frames, and had the code reviewed again. #812's fixes are merged in. Spacing (0358d2e)
Streak numbers agree with each other (db2cf46)
Snowflake on the right streak (db2cf46)
Work done once per page (db2cf46)
Readability (db2cf46)
CSS (db2cf46)
Not changed
Open question (product, not code)
New test: a freeze in an earlier, broken streak isn't placed on the best streak. The full suite passes (482 tests), PHPCS and PHPStan pass, and both widgets and popovers were checked in the browser, including tap/focus. |
Implements https://github.com/ProgressPlanner/progress-planner-pro/issues/190
Stacked on #812 (monthly badges popover). Merge #812 first; this PR then retargets to
develop.Design: Figma
popover-badges— widgets (stats page streak,stats page content badge), popovers (popover streak,stats page popover streak freeze,stats page popover streak completed,popover content badge), hover (streak animation,content badge animation).What this does
Widgets (streak + content)
Popovers (one per widget)
Clean-up
progress_planner_popover_after_streak_sectionsaction still fires in the new streak popover.progress_planner_popover_after_badge_groupsstill fires at its bottom, so pp-hosts' onboarding badges keep showing there.admin.css(used by all three popovers).Streak calculation fixes (
Goal_Recurring::get_streak())freeze_usedandfreeze_week, needed for the freeze line and the snowflake.New tests cover the freeze reporting, repeat calls, and the current week.
Notes for design
--prpl-color-button-primaryin Figma (red in PP). Brands set that to their button colour — on Zonnet it is purple. Used as designed; flagging in case a dedicated text colour is wanted.--prpl-background-streakin Figma (pink); this uses the content colour (--prpl-background-content-badge). One-line change if pink is intended.Follow-up outside this repo
tokens.json: addprogress-plannertoreadByof--prpl-color-alert-successand--prpl-font-size-xl(the tokens check warns).Testing
Checked in the browser on the Zonnet brand at 1400px and 420px; console clean. The "all collected" variant was checked by temporarily marking the streak badges as earned (settings restored afterwards). Full PHPUnit suite passes (479 tests);
composer check-cs, PHPStan and CSS lint pass.Screenshots