diff --git a/lighthouse-plugin-publisher-ads/audits/deprecated-api-usage.js b/lighthouse-plugin-publisher-ads/audits/deprecated-api-usage.js index 29b8aa67..0c59afa3 100644 --- a/lighthouse-plugin-publisher-ads/audits/deprecated-api-usage.js +++ b/lighthouse-plugin-publisher-ads/audits/deprecated-api-usage.js @@ -23,6 +23,7 @@ const UIStrings = { 'page is tagged correctly. [Learn more](' + 'https://developers.google.com/publisher-ads-audits/reference/audits/deprecated-gpt-api-usage' + ').', + displayValue: '{numErrors, plural, =1 {1 error} other {# errors}} found', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -42,6 +43,7 @@ class DeprecatedApiUsage extends Audit { title: str_(UIStrings.title), failureTitle: str_(UIStrings.failureTitle), description: str_(UIStrings.description), + scoreDisplayMode: 'informative', requiredArtifacts: ['ConsoleMessages'], }; } @@ -82,6 +84,7 @@ class DeprecatedApiUsage extends Audit { return { score: Number(numErrors === 0), details, + displayValue: str_(UIStrings.displayValue, {numErrors}), }; } } diff --git a/lighthouse-plugin-publisher-ads/audits/gpt-errors-overall.js b/lighthouse-plugin-publisher-ads/audits/gpt-errors-overall.js index 32eccbcc..2a370448 100644 --- a/lighthouse-plugin-publisher-ads/audits/gpt-errors-overall.js +++ b/lighthouse-plugin-publisher-ads/audits/gpt-errors-overall.js @@ -23,6 +23,7 @@ const UIStrings = { '[Learn more](' + 'https://developers.google.com/publisher-ads-audits/reference/audits/gpt-errors-overall' + ').', + displayValue: '{numErrors, plural, =1 {1 error} other {# errors}} found', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -42,6 +43,7 @@ class GptErrorsOverall extends Audit { title: str_(UIStrings.title), failureTitle: str_(UIStrings.failureTitle), description: str_(UIStrings.description), + scoreDisplayMode: 'informative', requiredArtifacts: ['ConsoleMessages'], }; } @@ -82,6 +84,7 @@ class GptErrorsOverall extends Audit { return { score: Number(numErrors === 0), details, + displayValue: str_(UIStrings.displayValue, {numErrors}), }; } } diff --git a/lighthouse-plugin-publisher-ads/messages/en-US.json b/lighthouse-plugin-publisher-ads/messages/en-US.json index 642dffcd..52f87867 100644 --- a/lighthouse-plugin-publisher-ads/messages/en-US.json +++ b/lighthouse-plugin-publisher-ads/messages/en-US.json @@ -271,6 +271,22 @@ "message": "Cumulative ad shift", "description": "" }, + "audits/deprecated-api-usage.js | description": { + "message": "Deprecated GPT API methods should be avoided to ensure your page is tagged correctly. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/deprecated-gpt-api-usage).", + "description": "" + }, + "audits/deprecated-api-usage.js | displayValue": { + "message": "{numErrors, plural, =1 {1 error} other {# errors}} found", + "description": "" + }, + "audits/deprecated-api-usage.js | failureTitle": { + "message": "Avoid deprecated GPT APIs", + "description": "" + }, + "audits/deprecated-api-usage.js | title": { + "message": "Deprecated GPT API Usage", + "description": "" + }, "audits/duplicate-tags.js | columnFrameId": { "message": "Frame ID", "description": "" @@ -359,6 +375,22 @@ "message": "GPT and bids loaded in parallel", "description": "" }, + "audits/gpt-errors-overall.js | description": { + "message": "Fix GPT errors to ensure your page is tagged as intended. [Learn more](https://developers.google.com/publisher-ads-audits/reference/audits/gpt-errors-overall).", + "description": "" + }, + "audits/gpt-errors-overall.js | displayValue": { + "message": "{numErrors, plural, =1 {1 error} other {# errors}} found", + "description": "" + }, + "audits/gpt-errors-overall.js | failureTitle": { + "message": "Fix GPT errors", + "description": "" + }, + "audits/gpt-errors-overall.js | title": { + "message": "GPT Errors", + "description": "" + }, "audits/idle-network-times.js | causeDomContentLoaded": { "message": "DOMContentLoaded Event", "description": "" diff --git a/lighthouse-plugin-publisher-ads/messages/locales/en-XL.json b/lighthouse-plugin-publisher-ads/messages/locales/en-XL.json index a00d6b5f..815d00f4 100644 --- a/lighthouse-plugin-publisher-ads/messages/locales/en-XL.json +++ b/lighthouse-plugin-publisher-ads/messages/locales/en-XL.json @@ -203,6 +203,18 @@ "audits/cumulative-ad-shift.js | title": { "message": "Ĉúm̂úl̂át̂ív̂é âd́ ŝh́îf́t̂" }, + "audits/deprecated-api-usage.js | description": { + "message": "D̂ép̂ŕêćât́êd́ ĜṔT̂ ÁP̂Í m̂ét̂h́ôd́ŝ śĥóûĺd̂ b́ê áv̂óîd́êd́ t̂ó êńŝúr̂é ŷóûŕ p̂áĝé îś t̂áĝǵêd́ ĉór̂ŕêćt̂ĺŷ. [Ĺêár̂ń m̂ór̂é](ĥt́t̂ṕŝ://d́êv́êĺôṕêŕŝ.ǵôóĝĺê.ćôḿ/p̂úb̂ĺîśĥér̂-ád̂ś-âúd̂ít̂ś/r̂éf̂ér̂én̂ćê/áûd́ît́ŝ/d́êṕr̂éĉát̂éd̂-ǵp̂t́-âṕî-úŝáĝé)." + }, + "audits/deprecated-api-usage.js | displayValue": { + "message": "{numErrors, plural, =1 {1 êŕr̂ór̂} other {# ér̂ŕôŕŝ}} f́ôún̂d́" + }, + "audits/deprecated-api-usage.js | failureTitle": { + "message": "Âv́ôíd̂ d́êṕr̂éĉát̂éd̂ ǴP̂T́ ÂṔÎś" + }, + "audits/deprecated-api-usage.js | title": { + "message": "D̂ép̂ŕêćât́êd́ ĜṔT̂ ÁP̂Í Ûśâǵê" + }, "audits/duplicate-tags.js | columnFrameId": { "message": "F̂ŕâḿê ÍD̂" }, @@ -269,6 +281,18 @@ "audits/gpt-bids-parallel.js | title": { "message": "ĜṔT̂ án̂d́ b̂íd̂ś l̂óâd́êd́ îń p̂ár̂ál̂ĺêĺ" }, + "audits/gpt-errors-overall.js | description": { + "message": "F̂íx̂ ǴP̂T́ êŕr̂ór̂ś t̂ó êńŝúr̂é ŷóûŕ p̂áĝé îś t̂áĝǵêd́ âś îńt̂én̂d́êd́. [L̂éâŕn̂ ḿôŕê](h́t̂t́p̂ś://d̂év̂él̂óp̂ér̂ś.ĝóôǵl̂é.ĉóm̂/ṕûb́l̂íŝh́êŕ-âd́ŝ-áûd́ît́ŝ/ŕêf́êŕêńĉé/âúd̂ít̂ś/ĝṕt̂-ér̂ŕôŕŝ-óv̂ér̂ál̂ĺ)." + }, + "audits/gpt-errors-overall.js | displayValue": { + "message": "{numErrors, plural, =1 {1 êŕr̂ór̂} other {# ér̂ŕôŕŝ}} f́ôún̂d́" + }, + "audits/gpt-errors-overall.js | failureTitle": { + "message": "F̂íx̂ ǴP̂T́ êŕr̂ór̂ś" + }, + "audits/gpt-errors-overall.js | title": { + "message": "ĜṔT̂ Ér̂ŕôŕŝ" + }, "audits/idle-network-times.js | causeDomContentLoaded": { "message": "D̂ÓM̂Ćôńt̂én̂t́L̂óâd́êd́ Êv́êńt̂" }, diff --git a/lighthouse-plugin-publisher-ads/plugin.js b/lighthouse-plugin-publisher-ads/plugin.js index 171a5964..52f8b9df 100644 --- a/lighthouse-plugin-publisher-ads/plugin.js +++ b/lighthouse-plugin-publisher-ads/plugin.js @@ -79,7 +79,7 @@ module.exports = { {id: 'blocking-load-events', weight: 1, group: 'ads-performance'}, {id: 'ad-render-blocking-resources', weight: 1, group: 'ads-performance'}, {id: 'ad-blocking-tasks', weight: 1, group: 'ads-performance'}, - {id: 'ad-request-critical-path', weight: 1, group: 'ads-performance'}, + {id: 'ad-request-critical-path', weight: 0, group: 'ads-performance'}, // Best Practices group. {id: 'ads-in-viewport', weight: 4, group: 'ads-best-practices'}, {id: 'async-ad-tags', weight: 2, group: 'ads-best-practices'}, @@ -88,8 +88,8 @@ module.exports = { {id: 'viewport-ad-density', weight: 2, group: 'ads-best-practices'}, {id: 'ad-top-of-viewport', weight: 2, group: 'ads-best-practices'}, {id: 'duplicate-tags', weight: 1, group: 'ads-best-practices'}, - {id: 'deprecated-gpt-api-usage', weight: 1, group: 'ads-best-practices'}, - {id: 'gpt-errors-overall', weight: 5, group: 'ads-best-practices'}, + {id: 'deprecated-gpt-api-usage', weight: 0, group: 'ads-best-practices'}, + {id: 'gpt-errors-overall', weight: 0, group: 'ads-best-practices'}, ], }, }; diff --git a/lighthouse-plugin-publisher-ads/test/smoke/expectations/deprecated-api-usage.js b/lighthouse-plugin-publisher-ads/test/smoke/expectations/deprecated-api-usage.js index 0cf35194..7c78e313 100644 --- a/lighthouse-plugin-publisher-ads/test/smoke/expectations/deprecated-api-usage.js +++ b/lighthouse-plugin-publisher-ads/test/smoke/expectations/deprecated-api-usage.js @@ -23,7 +23,7 @@ module.exports = [ finalUrl: 'http://localhost:8081/deprecated-api-usage.html', audits: { 'deprecated-gpt-api-usage': { - score: 0, + score: null, details: { items: [ { diff --git a/lighthouse-plugin-publisher-ads/test/smoke/expectations/gpt-errors-overall.js b/lighthouse-plugin-publisher-ads/test/smoke/expectations/gpt-errors-overall.js index 83d528f5..8b62aa2c 100644 --- a/lighthouse-plugin-publisher-ads/test/smoke/expectations/gpt-errors-overall.js +++ b/lighthouse-plugin-publisher-ads/test/smoke/expectations/gpt-errors-overall.js @@ -23,7 +23,7 @@ module.exports = [ finalUrl: 'http://localhost:8081/gpt-errors-overall.html', audits: { 'gpt-errors-overall': { - score: 0, + score: null, details: { items: [ {