diff --git a/CHANGELOG.md b/CHANGELOG.md index 1aecceb95..f185ca45d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,14 @@ Fixed: -* Duplicate weekly suggested tasks. -* The REST API endpoint for getting stats. -* Scrollable monthly badges widget height on page load. -* 2026 monthly badges showing up +* Remove duplicated weekly suggested tasks. +* The REST API endpoint for getting stats was broken, causing the weekly emails not to work. +* Scrollable monthly badges widget was the wrong height on page load. +* 2026 monthly badges were showing up and shouldn't (yet). + +Enhancements: + +* Refocus the "add new task" input after a to-do item is added. = 1.0.1 = diff --git a/README.md b/README.md index bace46ec5..f588507af 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ # Progress Planner -![Progress Planner - Powering your website's progress](https://repository-images.githubusercontent.com/753019432/24c42936-cd56-4192-8f28-503073087bd1) +![Progress Planner - Powering your website's progress](https://repository-images.githubusercontent.com/753019432/5ca27f0c-4380-4b01-a18c-1c7633262659) ## What does this plugin do? diff --git a/assets/css/page-widgets/whats-new.css b/assets/css/page-widgets/whats-new.css index ed473c3b4..e03e63b45 100644 --- a/assets/css/page-widgets/whats-new.css +++ b/assets/css/page-widgets/whats-new.css @@ -57,4 +57,5 @@ border-radius: var(--prpl-border-radius); box-shadow: 5px 5px 5px var(--prpl-color-gray-2); border: 1px solid var(--prpl-color-gray-2); + background-color: var(--prpl-color-gray-1); /* Fallback, if remote host image is not accessible */ } diff --git a/assets/js/web-components/prpl-badge.js b/assets/js/web-components/prpl-badge.js index 851d07a98..9bba6b950 100644 --- a/assets/js/web-components/prpl-badge.js +++ b/assets/js/web-components/prpl-badge.js @@ -20,6 +20,9 @@ customElements.define( }" alt="Badge" ${ false === complete ? 'style="filter: grayscale(1);opacity: 0.25;"' : '' } + onerror="this.onerror=null;this.src='${ + progressPlannerBadge.placeholderImageUrl + }';" /> `; } diff --git a/assets/js/widgets/todo.js b/assets/js/widgets/todo.js index f028f86f7..570661929 100644 --- a/assets/js/widgets/todo.js +++ b/assets/js/widgets/todo.js @@ -50,11 +50,6 @@ const progressPlannerInjectTodoItem = ( content, done, addToStart, save ) => { document.getElementById( 'todo-list' ).appendChild( todoItemElement ); } - // Focus the new task's content element after it is added to the DOM - setTimeout( () => { - todoItemElement.querySelector( 'input[type="checkbox"]' ).focus(); - }, 0 ); - if ( save ) { progressPlannerSaveTodoList(); } @@ -91,5 +86,8 @@ prplDocumentReady( () => { ); document.getElementById( 'new-todo-content' ).value = ''; + + // Focus the new task input element. + document.getElementById( 'new-todo-content' ).focus(); } ); } ); diff --git a/classes/admin/class-scripts.php b/classes/admin/class-scripts.php index 04e72d4fe..a14a736d4 100644 --- a/classes/admin/class-scripts.php +++ b/classes/admin/class-scripts.php @@ -102,6 +102,7 @@ public function localize_script( $handle ) { 'progressPlannerBadge', [ 'remoteServerRootUrl' => \progress_planner()->get_remote_server_root_url(), + 'placeholderImageUrl' => \progress_planner()->get_placeholder_svg(), ] ); break; diff --git a/classes/class-base.php b/classes/class-base.php index 935424651..1b70babbe 100644 --- a/classes/class-base.php +++ b/classes/class-base.php @@ -170,6 +170,18 @@ public function get_remote_server_root_url() { : 'https://progressplanner.com'; } + /** + * Get the placeholder SVG. + * + * @param int $width The width of the placeholder image. + * @param int $height The height of the placeholder image. + * + * @return string + */ + public function get_placeholder_svg( $width = 1200, $height = 675 ) { + return 'data:image/svg+xml;base64,' . base64_encode( sprintf( 'progressplanner.com', $width, $height, ( $width - 4 ), ( $height - 4 ) ) ); + } + /** * Get the activation date. * diff --git a/package.json b/package.json index 8a24be634..82cdd397f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "progress-planner", - "version": "1.0.0", + "version": "1.0.2", "private": true, "description": "WordPress plugin", "author": "Team Emilia Projects", diff --git a/progress-planner.php b/progress-planner.php index 1eedc7f47..6cdad75b8 100644 --- a/progress-planner.php +++ b/progress-planner.php @@ -9,7 +9,7 @@ * Description: A plugin to help you fight procrastination and get things done. * Requires at least: 6.3 * Requires PHP: 7.4 - * Version: 1.0.1 + * Version: 1.0.2 * Author: Team Emilia Projects * Author URI: https://prpl.fyi/about * License: GPL-3.0+ diff --git a/readme.txt b/readme.txt index d560223e4..827a9ac55 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: planning, maintenance, writing, blogging Requires at least: 6.3 Tested up to: 6.7 Requires PHP: 7.4 -Stable tag: 1.0.1 +Stable tag: 1.0.2 License: GPL3+ License URI: https://www.gnu.org/licenses/gpl-3.0.en.html @@ -78,6 +78,19 @@ https://youtu.be/e1bmxZYyXFY == Changelog == += 1.0.2 = + +Fixed: + +* Remove duplicated weekly suggested tasks. +* The REST API endpoint for getting stats was broken, causing the weekly emails not to work. +* Scrollable monthly badges widget was the wrong height on page load. +* 2026 monthly badges were showing up and shouldn't (yet). + +Enhancements: + +* Refocus the "add new task" input after a to-do item is added. + = 1.0.1 = Fixed: diff --git a/views/page-widgets/latest-badge.php b/views/page-widgets/latest-badge.php index 2bde8bac7..70890a495 100644 --- a/views/page-widgets/latest-badge.php +++ b/views/page-widgets/latest-badge.php @@ -37,6 +37,7 @@ alt="get_name() ); ?>" width="1200" height="675" + onerror="this.onerror=null;this.src='get_placeholder_svg() ); ?>';" /> is_local_site() ) : ?>