From 31207a2aaa7864ad574c5a56e0bcb33fb8110826 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 30 Apr 2024 10:35:00 +0530 Subject: [PATCH 1/5] Add Progress indicator --- includes/admin/load.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/includes/admin/load.php b/includes/admin/load.php index 0701c29837..d87bbed89a 100644 --- a/includes/admin/load.php +++ b/includes/admin/load.php @@ -50,6 +50,9 @@ function perflab_load_features_page() { // Handle style for settings page. add_action( 'admin_head', 'perflab_print_features_page_style' ); + + // Handle script for settings page. + add_action( 'admin_footer', 'perflab_print_plugin_progress_indicator_script' ); } /** @@ -393,3 +396,30 @@ static function ( $name ) { ); } } + +/** + * Callback function that print plugin progress indicator script. + * + * @since n.e.x.t + */ +function perflab_print_plugin_progress_indicator_script() { + $js = << Date: Tue, 30 Apr 2024 10:36:39 +0530 Subject: [PATCH 2/5] Add empty line --- includes/admin/load.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/load.php b/includes/admin/load.php index d87bbed89a..8178191665 100644 --- a/includes/admin/load.php +++ b/includes/admin/load.php @@ -422,4 +422,4 @@ function perflab_print_plugin_progress_indicator_script() { JS; wp_print_inline_script_tag( $js ); -} \ No newline at end of file +} From 59dc0945245dfecac2e99f87eee0daf57590f37a Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 30 Apr 2024 11:17:25 +0530 Subject: [PATCH 3/5] Apply suggestions from code review --- includes/admin/load.php | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/includes/admin/load.php b/includes/admin/load.php index 8178191665..9a65e93686 100644 --- a/includes/admin/load.php +++ b/includes/admin/load.php @@ -403,23 +403,30 @@ static function ( $name ) { * @since n.e.x.t */ function perflab_print_plugin_progress_indicator_script() { - $js = << 'module' ) + ); } From 4229c4fa4ee1da0763879dd8f10685ada7c27276 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 30 Apr 2024 12:48:02 +0530 Subject: [PATCH 4/5] Add a11y message --- includes/admin/load.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/admin/load.php b/includes/admin/load.php index 9a65e93686..ecee8ecf02 100644 --- a/includes/admin/load.php +++ b/includes/admin/load.php @@ -415,6 +415,8 @@ function addPluginProgressIndicator( message ) { const target = event.target; target.classList.add( 'updating-message' ); target.textContent = message; + + wp.a11y.speak(message); } } ); } ); From b5e675105396de0e655eeb29903a2d72ebdcad23 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Tue, 30 Apr 2024 16:31:25 +0530 Subject: [PATCH 5/5] Enqueue a11y script --- includes/admin/load.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/admin/load.php b/includes/admin/load.php index ecee8ecf02..9c12856e1f 100644 --- a/includes/admin/load.php +++ b/includes/admin/load.php @@ -227,6 +227,9 @@ function perflab_enqueue_features_page_scripts() { wp_enqueue_script( 'thickbox' ); wp_enqueue_style( 'thickbox' ); wp_enqueue_script( 'plugin-install' ); + + // Enqueue the a11y script. + wp_enqueue_script( 'wp-a11y' ); } /**