Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily set GPT API audits as informational #255

Merged
merged 5 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -42,6 +43,7 @@ class DeprecatedApiUsage extends Audit {
title: str_(UIStrings.title),
failureTitle: str_(UIStrings.failureTitle),
description: str_(UIStrings.description),
scoreDisplayMode: 'informative',
requiredArtifacts: ['ConsoleMessages'],
};
}
Expand Down Expand Up @@ -82,6 +84,7 @@ class DeprecatedApiUsage extends Audit {
return {
score: Number(numErrors === 0),
details,
displayValue: str_(UIStrings.displayValue, {numErrors}),
};
}
}
Expand Down
3 changes: 3 additions & 0 deletions lighthouse-plugin-publisher-ads/audits/gpt-errors-overall.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -42,6 +43,7 @@ class GptErrorsOverall extends Audit {
title: str_(UIStrings.title),
failureTitle: str_(UIStrings.failureTitle),
description: str_(UIStrings.description),
scoreDisplayMode: 'informative',
requiredArtifacts: ['ConsoleMessages'],
};
}
Expand Down Expand Up @@ -82,6 +84,7 @@ class GptErrorsOverall extends Audit {
return {
score: Number(numErrors === 0),
details,
displayValue: str_(UIStrings.displayValue, {numErrors}),
};
}
}
Expand Down
32 changes: 32 additions & 0 deletions lighthouse-plugin-publisher-ads/messages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""
Expand Down Expand Up @@ -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": ""
Expand Down
24 changes: 24 additions & 0 deletions lighthouse-plugin-publisher-ads/messages/locales/en-XL.json
Original file line number Diff line number Diff line change
Expand Up @@ -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̂"
},
Expand Down Expand Up @@ -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̂"
},
Expand Down
6 changes: 3 additions & 3 deletions lighthouse-plugin-publisher-ads/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand All @@ -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'},
],
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = [
finalUrl: 'http://localhost:8081/gpt-errors-overall.html',
audits: {
'gpt-errors-overall': {
score: 0,
score: null,
details: {
items: [
{
Expand Down