diff --git a/assets/css/build/style-style.scss.css b/assets/css/build/style-style.scss.css index 576df576..07716752 100644 --- a/assets/css/build/style-style.scss.css +++ b/assets/css/build/style-style.scss.css @@ -1 +1 @@ -.http_100,.http_101,.http_102,.http_103{background-color:#e6f7ff}.http_200,.http_201,.http_202,.http_203,.http_204,.http_205,.http_206,.http_207,.http_208,.http_226{background-color:#e6ffe6}.http_300,.http_301,.http_302,.http_303,.http_304,.http_305,.http_306,.http_307,.http_308{background-color:#fff2e6}.http_400,.http_401,.http_402,.http_403,.http_404,.http_405,.http_406,.http_407,.http_408,.http_409,.http_410,.http_411,.http_412,.http_413,.http_414,.http_415,.http_416,.http_417,.http_418,.http_421,.http_422,.http_423,.http_424,.http_425,.http_426,.http_428,.http_429,.http_431,.http_451{background-color:#ffe6e6}.http_500,.http_501,.http_502,.http_503,.http_504,.http_505,.http_506,.http_507,.http_508,.http_510,.http_511{background-color:#ffe6ff}.http_none{background-color:#e6e6e6}@keyframes pulse{0%{background-color:#ebffff}50%{background-color:#f8ebff}50%{background-color:rgba(255,255,255,0)}}#wlf-meta-box-results h2{padding:0;margin-bottom:1em;font-size:19px;color:#db7093}#wlf-meta-box-results .report{border:1px solid #000;padding:5px 7px}#wlf-meta-box-results .report p{margin-bottom:2px}#wlf-meta-box-results .report a{text-align:center;display:block}#wlf-meta-box-results div{margin-bottom:5px}#wlf-meta-box-results.updated-results{animation:pulse 5s}#wlf-meta-box-runner div{margin-bottom:5px}#wlf-meta-box-runner .checkbox_container{display:flex;align-items:flex-end;justify-content:space-between}#wlf-meta-box-runner .text_container label{line-height:25px}#wlf-meta-box-runner .button_container{text-align:center;padding-top:5px}#wlf-meta-box-results__progress{padding:5px;text-align:center;background-color:#00891d;color:#fff;font-weight:500;margin-top:10px;border-radius:10px}#wlf_excluded_links{padding:5px;border:1px solid #cfcfcf;margin:5px 0}#wlf_excluded_links #wlf_excluded_empty{text-align:center;color:#cfcfcf}#wlf_excluded_links .link,#wlf_excluded_links .new-link{display:flex}#wlf_excluded_links .link input,#wlf_excluded_links .new-link input{max-width:100%;width:-webkit-fill-available}#wlf_excluded_links .new-link{margin-bottom:10px;background-color:#cfcfcf;padding:10px}.wlf_settings_postbox{position:relative;min-width:255px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;margin-bottom:20px;padding-top:0}.wlf_settings_postbox h2{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #c3c4c7;padding:10px;margin:0;font-size:14px;padding:8px 12px;line-height:14px}.wlf_settings_postbox table.form-table th{padding-left:10px;font-size:13px}.wlf_settings_postbox>p.description{padding:10px 15px 5px}.wlf_settings_card{box-shadow:0 4px 12px rgba(0,0,0,.06),0 0 2px rgba(0,0,0,.16);border-radius:8px;overflow:hidden;padding:5px 10px;background-color:#fff;margin-bottom:20px}.wlf_settings_post_types{display:grid;grid-template-columns:auto auto;gap:16px;width:-moz-fit-content;width:fit-content}.wlf_read-only{pointer-events:none;background-color:#f9f9f9}#wlf-events-trigger{padding:5px;border:1px solid #000;background:#d9d9d9}#wlf-events-trigger h2{margin-top:0}#wlf-events-trigger .wlf-event-trigger-row{padding:2px;margin-bottom:5px}#wlf-events-trigger .wlf-event-trigger-row p{margin:0;margin-top:3px}#wlf-events-trigger .wlf-event-trigger-row p span.description{color:#646970}#wlf-events-trigger .wlf-event-trigger-row input[type=text]{width:100%}#wlf-events-trigger .wlf-event-trigger-row p.with-checkbox input[type=checkbox]{margin-left:5px}#wlf-events-trigger .wlf-event-trigger-row .checkbox-grid{display:flex}#wlf-events-trigger .wlf-event-trigger-row .checkbox-grid label{display:block;padding:5px}#wlf-events-trigger .wlf-event-trigger-row #wlf-event-select2-errors{font-size:medium;text-align:center;color:red;font-weight:700}#wlf-events-trigger .select2-container--default .select2-selection--multiple{padding-bottom:0px}.wp-list-table.reports .column-report-link-archive,.wp-list-table.reports .column-report-is-broken,.wp-list-table.reports .column-report-link-checks,.wp-list-table.reports .column-report-link-exclude{max-width:10%;width:135px;text-align:center}@media(max-width: 1200px){.wp-list-table.reports .column-report-link-archive,.wp-list-table.reports .column-report-is-broken,.wp-list-table.reports .column-report-link-checks,.wp-list-table.reports .column-report-link-exclude{max-width:unset;width:unset}}.wp-list-table.reports .column-report-link-checks-last{max-width:30%;width:240px}@media(max-width: 1200px){.wp-list-table.reports .column-report-link-checks-last{max-width:unset;width:unset}}.wp-list-table.reports .dashicons.dashicons-yes-alt{color:#2271b1}.wp-list-table.reports .report-link-url a:first-of-type{display:inline-block;max-width:calc(100% - 30px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}.wp-list-table.reports .report-link-url .dashicons{display:inline-block;vertical-align:middle;margin-left:5px}.contextual-help-tabs-wrap .wlf_help_tab h3{font-size:1.2em;margin-bottom:.25em}.contextual-help-tabs-wrap .wlf_help_tab p{margin:.25em 0}#wlf_help_info_bulk_actions{cursor:pointer}#wlf_wizard{padding:20px 30px;background:#fff;border-radius:10px;width:500px;min-width:250px;max-width:calc(100% - 60px);margin-left:auto;margin-right:auto}#wlf_wizard input[type=checkbox]{-webkit-appearance:none;appearance:none;width:40px;height:20px;background:#ccc;border-radius:20px;position:relative;cursor:pointer;transition:background .3s;margin:inherit}#wlf_wizard input[type=checkbox]::before{content:"";position:absolute;width:16px;height:16px;background:#fff;border-radius:50%;top:1px;left:2px;transition:transform .3s}#wlf_wizard input[type=checkbox]:checked{background:#2271b1}#wlf_wizard input[type=checkbox]:checked::before{transform:translateX(20px);top:4px;left:5px}#wlf_wizard input[type=text],#wlf_wizard input[type=password],#wlf_wizard select{width:100%;padding:10px;font-size:19px;max-width:unset}#wlf-wizard__footer{display:flex;width:100%;align-items:center;justify-content:space-between}.wlf-wizard__footer__progress{flex-grow:1;display:flex;align-items:center;justify-content:center;padding:0 25px;width:100%}@media(max-width: 499px){.wlf-wizard__footer__progress{display:none}}.wlf-wizard__footer__progress__bar{width:100%;justify-content:center;align-items:center;display:inline;text-align:center;position:relative}.wlf-wizard__footer__progress__bar .wlf-wizard__footer__progress__bar__inner{background-color:#2271b1;height:5px;position:relative;z-index:1}.wlf-wizard__footer__progress__bar::before{content:"";position:absolute;bottom:0;left:0;height:5px;background-color:#f5f5f5;width:100%;transition:width .3s ease-in-out;z-index:0}.wlf-wizard__content form{display:flex;flex-direction:column}.wlf-wizard__content__field{display:flex;flex-direction:column;margin-bottom:20px;justify-content:center;align-items:flex-start}.wlf-wizard__content__field.is_optional.disabled{display:none}.wlf-wizard__content__field label{font-size:17px;line-height:20px;margin-bottom:6px;font-weight:400}.wlf-wizard__content__inner-field .inner-spaced-between__list{display:flex;align-items:center;justify-content:space-between;padding:3px 25px}.wlf-wizard__content__inner-field .inner-spaced-between__list:hover{background-color:#f9f9f9}.wlf-wizard__content__inner-field .inner-spaced-between{display:flex;align-items:center;justify-content:space-between;width:100%}.wlf-wizard__content__inner-field.checkbox{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%}.wlf-wizard__content__inner-field.checkbox input{margin:10px}.wlf-wizard__content__inner-field.checkboxes{width:100%}.wlf-wizard__content__inner-field p.description{width:100%} +.http_100,.http_101,.http_102,.http_103{background-color:#e6f7ff}.http_200,.http_201,.http_202,.http_203,.http_204,.http_205,.http_206,.http_207,.http_208,.http_226{background-color:#e6ffe6}.http_300,.http_301,.http_302,.http_303,.http_304,.http_305,.http_306,.http_307,.http_308{background-color:#fff2e6}.http_400,.http_401,.http_402,.http_403,.http_404,.http_405,.http_406,.http_407,.http_408,.http_409,.http_410,.http_411,.http_412,.http_413,.http_414,.http_415,.http_416,.http_417,.http_418,.http_421,.http_422,.http_423,.http_424,.http_425,.http_426,.http_428,.http_429,.http_431,.http_451{background-color:#ffe6e6}.http_500,.http_501,.http_502,.http_503,.http_504,.http_505,.http_506,.http_507,.http_508,.http_510,.http_511{background-color:#ffe6ff}.http_none{background-color:#e6e6e6}@keyframes pulse{0%{background-color:#ebffff}50%{background-color:#f8ebff}50%{background-color:rgba(255,255,255,0)}}#wlf-meta-box-results h2{padding:0;margin-bottom:1em;font-size:19px;color:#db7093}#wlf-meta-box-results .report{border:1px solid #000;padding:5px 7px}#wlf-meta-box-results .report p{margin-bottom:2px}#wlf-meta-box-results .report a{text-align:center;display:block}#wlf-meta-box-results div{margin-bottom:5px}#wlf-meta-box-results.updated-results{animation:pulse 5s}#wlf-meta-box-runner div{margin-bottom:5px}#wlf-meta-box-runner .checkbox_container{display:flex;align-items:flex-end;justify-content:space-between}#wlf-meta-box-runner .text_container label{line-height:25px}#wlf-meta-box-runner .button_container{text-align:center;padding-top:5px}#wlf-meta-box-results__progress{padding:5px;text-align:center;background-color:#00891d;color:#fff;font-weight:500;margin-top:10px;border-radius:10px}#wlf_excluded_links{padding:5px;border:1px solid #cfcfcf;margin:5px 0}#wlf_excluded_links #wlf_excluded_empty{text-align:center;color:#cfcfcf}#wlf_excluded_links .link,#wlf_excluded_links .new-link{display:flex}#wlf_excluded_links .link input,#wlf_excluded_links .new-link input{max-width:100%;width:-webkit-fill-available}#wlf_excluded_links .new-link{margin-bottom:10px;background-color:#cfcfcf;padding:10px}.wlf_settings_postbox{position:relative;min-width:255px;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;margin-bottom:20px;padding-top:0}.wlf_settings_postbox h2{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #c3c4c7;padding:10px;margin:0;font-size:14px;padding:8px 12px;line-height:14px}.wlf_settings_postbox table.form-table th{padding-left:10px;font-size:13px}.wlf_settings_postbox>p.description{padding:10px 15px 5px}.wlf_settings_card{box-shadow:0 4px 12px rgba(0,0,0,.06),0 0 2px rgba(0,0,0,.16);border-radius:8px;overflow:hidden;padding:5px 10px;background-color:#fff;margin-bottom:20px}.wlf_settings_post_types{display:grid;grid-template-columns:auto auto;gap:16px;width:-moz-fit-content;width:fit-content}.wlf_read-only{pointer-events:none;background-color:#f9f9f9}.wlf_toggle_setting__invalid_api_keys input{border-color:#dc3232}#invalid_api_creds{text-align:center}#invalid_api_creds p{color:#dc3232;font-weight:600;margin:0}#wlf-events-trigger{padding:5px;border:1px solid #000;background:#d9d9d9}#wlf-events-trigger h2{margin-top:0}#wlf-events-trigger .wlf-event-trigger-row{padding:2px;margin-bottom:5px}#wlf-events-trigger .wlf-event-trigger-row p{margin:0;margin-top:3px}#wlf-events-trigger .wlf-event-trigger-row p span.description{color:#646970}#wlf-events-trigger .wlf-event-trigger-row input[type=text]{width:100%}#wlf-events-trigger .wlf-event-trigger-row p.with-checkbox input[type=checkbox]{margin-left:5px}#wlf-events-trigger .wlf-event-trigger-row .checkbox-grid{display:flex}#wlf-events-trigger .wlf-event-trigger-row .checkbox-grid label{display:block;padding:5px}#wlf-events-trigger .wlf-event-trigger-row #wlf-event-select2-errors{font-size:medium;text-align:center;color:red;font-weight:700}#wlf-events-trigger .select2-container--default .select2-selection--multiple{padding-bottom:0px}.wp-list-table.reports .column-report-link-archive,.wp-list-table.reports .column-report-is-broken,.wp-list-table.reports .column-report-link-checks,.wp-list-table.reports .column-report-link-exclude{max-width:10%;width:135px;text-align:center}@media(max-width: 1200px){.wp-list-table.reports .column-report-link-archive,.wp-list-table.reports .column-report-is-broken,.wp-list-table.reports .column-report-link-checks,.wp-list-table.reports .column-report-link-exclude{max-width:unset;width:unset}}.wp-list-table.reports .column-report-link-checks-last{max-width:30%;width:240px}@media(max-width: 1200px){.wp-list-table.reports .column-report-link-checks-last{max-width:unset;width:unset}}.wp-list-table.reports .dashicons.dashicons-yes-alt{color:#2271b1}.wp-list-table.reports .report-link-url a:first-of-type{display:inline-block;max-width:calc(100% - 30px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}.wp-list-table.reports .report-link-url .dashicons{display:inline-block;vertical-align:middle;margin-left:5px}.contextual-help-tabs-wrap .wlf_help_tab h3{font-size:1.2em;margin-bottom:.25em}.contextual-help-tabs-wrap .wlf_help_tab p{margin:.25em 0}#wlf_help_info_bulk_actions{cursor:pointer}#wlf_wizard{padding:20px 30px;background:#fff;border-radius:10px;width:500px;min-width:250px;max-width:calc(100% - 60px);margin-left:auto;margin-right:auto}#wlf_wizard input[type=checkbox]{-webkit-appearance:none;appearance:none;width:40px;height:20px;background:#ccc;border-radius:20px;position:relative;cursor:pointer;transition:background .3s;margin:inherit}#wlf_wizard input[type=checkbox]::before{content:"";position:absolute;width:16px;height:16px;background:#fff;border-radius:50%;top:1px;left:2px;transition:transform .3s}#wlf_wizard input[type=checkbox]:checked{background:#2271b1}#wlf_wizard input[type=checkbox]:checked::before{transform:translateX(20px);top:4px;left:5px}#wlf_wizard input[type=text],#wlf_wizard input[type=password],#wlf_wizard select{width:100%;padding:10px;font-size:19px;max-width:unset}#wlf_wizard input.invalid{border-color:#dc3232}#wlf-wizard__footer{display:flex;width:100%;align-items:center;justify-content:space-between}.wlf-wizard__footer__progress{flex-grow:1;display:flex;align-items:center;justify-content:center;padding:0 25px;width:100%}@media(max-width: 499px){.wlf-wizard__footer__progress{display:none}}.wlf-wizard__footer__progress__bar{width:100%;justify-content:center;align-items:center;display:inline;text-align:center;position:relative}.wlf-wizard__footer__progress__bar .wlf-wizard__footer__progress__bar__inner{background-color:#2271b1;height:5px;position:relative;z-index:1}.wlf-wizard__footer__progress__bar::before{content:"";position:absolute;bottom:0;left:0;height:5px;background-color:#f5f5f5;width:100%;transition:width .3s ease-in-out;z-index:0}.wlf-wizard__content form{display:flex;flex-direction:column}.wlf-wizard__content__field{display:flex;flex-direction:column;margin-bottom:20px;justify-content:center;align-items:flex-start}.wlf-wizard__content__field.is_optional.disabled{display:none}.wlf-wizard__content__field label{font-size:17px;line-height:20px;margin-bottom:6px;font-weight:400}.wlf-wizard__content__inner-field .inner-spaced-between__list{display:flex;align-items:center;justify-content:space-between;padding:3px 25px}.wlf-wizard__content__inner-field .inner-spaced-between__list:hover{background-color:#f9f9f9}.wlf-wizard__content__inner-field .inner-spaced-between{display:flex;align-items:center;justify-content:space-between;width:100%}.wlf-wizard__content__inner-field.checkbox{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%}.wlf-wizard__content__inner-field.checkbox input{margin:10px}.wlf-wizard__content__inner-field.checkboxes{width:100%}.wlf-wizard__content__inner-field p.description{width:100%} diff --git a/assets/css/src/admin/_settings.scss b/assets/css/src/admin/_settings.scss index de1091e0..39148ae6 100644 --- a/assets/css/src/admin/_settings.scss +++ b/assets/css/src/admin/_settings.scss @@ -70,4 +70,17 @@ .wlf_read-only { pointer-events: none; background-color: #f9f9f9; +} + +.wlf_toggle_setting__invalid_api_keys input { + border-color: #dc3232; +} + +#invalid_api_creds { + text-align: center; + p { + color: #dc3232; + font-weight: 600; + margin: 0; + } } \ No newline at end of file diff --git a/assets/css/src/admin/_wizard.scss b/assets/css/src/admin/_wizard.scss index 3e116587..de9cbc2a 100644 --- a/assets/css/src/admin/_wizard.scss +++ b/assets/css/src/admin/_wizard.scss @@ -7,7 +7,6 @@ max-width: calc(100% - 60px); margin-left: auto; margin-right: auto; - input[type="checkbox"] { appearance: none; width: 40px; @@ -18,7 +17,6 @@ cursor: pointer; transition: background 0.3s; margin: inherit; - &::before { content: ""; position: absolute; @@ -30,10 +28,8 @@ left: 2px; transition: transform 0.3s; } - &:checked { background: #2271b1; - &::before { transform: translateX(20px); top: 4px; @@ -41,7 +37,6 @@ } } } - input[type="text"], input[type="password"], select { @@ -50,6 +45,9 @@ font-size: 19px; max-width: unset; } + input.invalid { + border-color: #dc3232; + } } #wlf-wizard__footer { @@ -66,7 +64,6 @@ justify-content: center; padding: 0 25px; width: 100%; - @media (max-width: 499px) { display: none; } @@ -78,26 +75,24 @@ align-items: center; display: inline; text-align: center; - position: relative; - - .wlf-wizard__footer__progress__bar__inner { - background-color: #2271b1; - height: 5px; - position: relative; - z-index: 1; - } - - &::before { - content: ""; - position: absolute; - bottom: 0; - left: 0; - height: 5px; - background-color: #f5f5f5; - width: 100%; - transition: width 0.3s ease-in-out; - z-index: 0; - } + position: relative; + .wlf-wizard__footer__progress__bar__inner { + background-color: #2271b1; + height: 5px; + position: relative; + z-index: 1; + } + &::before { + content: ""; + position: absolute; + bottom: 0; + left: 0; + height: 5px; + background-color: #f5f5f5; + width: 100%; + transition: width 0.3s ease-in-out; + z-index: 0; + } } .wlf-wizard__content { @@ -105,18 +100,15 @@ display: flex; flex-direction: column; } - &__field { display: flex; flex-direction: column; margin-bottom: 20px; justify-content: center; align-items: flex-start; - &.is_optional.disabled { display: none; } - label { font-size: 17px; line-height: 20px; @@ -124,44 +116,37 @@ font-weight: 400; } } - &__inner-field { .inner-spaced-between__list { display: flex; align-items: center; justify-content: space-between; padding: 3px 25px; - &:hover { background-color: #f9f9f9; } } - .inner-spaced-between { display: flex; align-items: center; justify-content: space-between; width: 100%; } - &.checkbox { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; - input { margin: 10px; } } - &.checkboxes { width: 100%; } - p.description { width: 100%; } } -} +} \ No newline at end of file diff --git a/functions.php b/functions.php index 9a98d5fd..828e4c59 100644 --- a/functions.php +++ b/functions.php @@ -13,6 +13,7 @@ use WPCOMSpecialProjects\Wayback_Link_Fixer\Plugin; use WPCOMSpecialProjects\Wayback_Link_Fixer\Settings\Settings; use WPCOMSpecialProjects\Wayback_Link_Fixer\Migration\Migrations; +use WPCOMSpecialProjects\Wayback_Link_Fixer\Settings\Settings_Page; use WPCOMSpecialProjects\Wayback_Link_Fixer\Wayback_Machine\Snapshot_Client; use WPCOMSpecialProjects\Wayback_Link_Fixer\Wayback_Machine\Link_Checker_Client; use WPCOMSpecialProjects\Wayback_Link_Fixer\Wayback_Machine\HTTP_Client\HTTP_Snapshot_Client; @@ -105,6 +106,17 @@ function wpcomsp_wayback_link_fixer_get_link_checker_client(): Link_Checker_Clie return apply_filters( 'wlf_link_checker_client', new HTTP_Link_Checker_Client() ); } +/** + * Get the current System Client. + * + * @since 1.3.0 + * + * @return WPCOMSpecialProjects\Wayback_Link_Fixer\Wayback_Machine\System_Client + */ +function wpcomsp_wayback_link_fixer_get_system_client(): \WPCOMSpecialProjects\Wayback_Link_Fixer\Wayback_Machine\System_Client { + return apply_filters( 'wlf_system_client', new \WPCOMSpecialProjects\Wayback_Link_Fixer\Wayback_Machine\HTTP_Client\HTTP_System_Client() ); +} + /** * Render a template with args. * @@ -246,18 +258,40 @@ function wpcomsp_wayback_link_fixer_get_date_format(): string { * @return void */ function wpcomsp_wayback_link_fixer_render_not_authenticated_notice(): void { - // If we have authentication details for the Wayback Machine, bail. - if ( Settings::is_archive_api_configured() ) { + $in_unauthenticated_mode = __( 'You are using Link Fixer in unauthenticated mode, which restricts you to 4000 new snapshots per day. To unlock higher limits, please enter your API credentials to authenticate with Archive.org.', 'wpcomsp_wayback_link_fixer' ); + + // If the archive api is not configured. + if ( ! Settings::is_archive_api_configured() ) { + ?> +
+ +
+- -
-+ Please check your settings.. As a result you are in in unauthenticated mode, which restricts you to 4000 new snapshots per day.', 'wpcomsp_wayback_link_fixer' ), + esc_url( admin_url( 'options-general.php?page=' . Settings_Page::PAGE_SLUG ) ) + ) + ); + ?> +
+' . sprintf( + 'after_section' => $this->render_invalid_api_keys_message() . '
' . sprintf( // Translators: %s is the link to the Internet account setup. __( "To get your API key and secret, please visit the Internet Archive and create a new 'S3 access key' (this is a type of credential used by Archive.org).", 'wpcomsp_wayback_link_fixer' ), esc_url( 'https://archive.org/account/s3.php' ) @@ -460,7 +461,10 @@ function () { __( 'Archive.org Access Key', 'wpcomsp_wayback_link_fixer' ), array( $this, 'render_archive_api_access_key' ), self::PAGE_SLUG, - self::GROUP_IA_SETTINGS + self::GROUP_IA_SETTINGS, + array( + 'class' => Settings::has_valid_archive_api_credentials() ? '' : 'wlf_toggle_setting__invalid_api_keys', + ) ); add_settings_field( @@ -468,7 +472,10 @@ function () { __( 'Archive.org Secret Key', 'wpcomsp_wayback_link_fixer' ), array( $this, 'render_archive_api_secret_key' ), self::PAGE_SLUG, - self::GROUP_IA_SETTINGS + self::GROUP_IA_SETTINGS, + array( + 'class' => Settings::has_valid_archive_api_credentials() ? '' : 'wlf_toggle_setting__invalid_api_keys', + ) ); add_settings_field( @@ -507,6 +514,46 @@ function () { ); } + /** + * Renders the invalid API Keys message. + * + * @since 1.3.0 + * + * @return string + */ + public function render_invalid_api_keys_message(): string { + if ( ! Settings::has_valid_archive_api_credentials() ) { + return '
' . esc_html__( 'The Archive.org API keys are invalid. Please check your settings.', 'wpcomsp_wayback_link_fixer' ) . '