diff --git a/functions.php b/functions.php index cf51c415..37a99f5b 100644 --- a/functions.php +++ b/functions.php @@ -276,7 +276,7 @@ function iawmlf_render_not_authenticated_notice(): void { // If the archive api is not configured. if ( ! Settings::is_archive_api_configured() ) { ?> -
+

diff --git a/src/Dashboard/Report_Page.php b/src/Dashboard/Report_Page.php index df80cfa7..c1aba04c 100644 --- a/src/Dashboard/Report_Page.php +++ b/src/Dashboard/Report_Page.php @@ -267,7 +267,6 @@ private function render_list_page(): void { // Render any notices. $table->render_notices(); - iawmlf_render_not_authenticated_notice(); // Get the current page. $current_page = isset( $_REQUEST['page'] ) ? \sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ) : self::SLUG; // phpcs:ignore WordPress.Security.NonceVerification.Recommended, Can be linked, so no nonce possible. diff --git a/src/Dashboard/Settings_Page.php b/src/Dashboard/Settings_Page.php index 9f38e423..f2939b6e 100644 --- a/src/Dashboard/Settings_Page.php +++ b/src/Dashboard/Settings_Page.php @@ -567,6 +567,8 @@ function () { array( 'class' => Settings::is_link_processing_enabled() ? 'iawmlf_toggle_setting__fixer' : 'iawmlf_toggle_setting__fixer hidden' ) ); + $empty_api_creds = '' === Settings::get_archive_access_key() && '' === Settings::get_archive_secret_key(); + add_settings_field( Settings::ARCHIVE_ORG_ACCESS_KEY, __( 'Archive.org Access Key', 'internet-archive-wayback-machine-link-fixer' ), @@ -574,7 +576,7 @@ function () { self::PAGE_SLUG, self::GROUP_IA_SETTINGS, array( - 'class' => Settings::has_valid_archive_api_credentials() ? '' : 'iawmlf_toggle_setting__invalid_api_keys', + 'class' => Settings::has_valid_archive_api_credentials() || $empty_api_creds ? '' : 'iawmlf_toggle_setting__invalid_api_keys', ) ); @@ -585,7 +587,7 @@ function () { self::PAGE_SLUG, self::GROUP_IA_SETTINGS, array( - 'class' => Settings::has_valid_archive_api_credentials() ? '' : 'iawmlf_toggle_setting__invalid_api_keys', + 'class' => Settings::has_valid_archive_api_credentials() || $empty_api_creds ? '' : 'iawmlf_toggle_setting__invalid_api_keys', ) ); @@ -633,6 +635,11 @@ function () { * @return string */ public function render_invalid_api_keys_message(): string { + // If both keys are empty, do not show any message. + if ( '' === Settings::get_archive_access_key() && '' === Settings::get_archive_secret_key() ) { + return ''; + } + if ( ! Settings::has_valid_archive_api_credentials() ) { return '

' . esc_html__( 'The Archive.org API keys are invalid. Please check your settings.', 'internet-archive-wayback-machine-link-fixer' ) . '

' . ''; diff --git a/templates/admin/dashboard/widget.php b/templates/admin/dashboard/widget.php index 548fd9ed..0c7600a1 100644 --- a/templates/admin/dashboard/widget.php +++ b/templates/admin/dashboard/widget.php @@ -22,12 +22,6 @@ ?>
- -
- -
- -
diff --git a/templates/admin/wizard/step-1.php b/templates/admin/wizard/step-1.php index 6c458183..87199efe 100644 --- a/templates/admin/wizard/step-1.php +++ b/templates/admin/wizard/step-1.php @@ -35,7 +35,7 @@
-

+


@@ -52,5 +52,4 @@ />
-