Skip to content

Commit

Permalink
feat: add #TBD - Do not use plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
hrenaud committed Apr 1, 2024
1 parent 903911b commit b72edca
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/bonnes-pratiques/01-bp-greenit.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ order: 300
- [x] Éviter les redirections
- [ ] Optimiser les images bitmap
- [ ] Optimiser les images svg
- [ ] Ne pas utiliser de plugins
- [x] Ne pas utiliser de plugins
- [x] Fournir une feuille de style pour l'impression (test : https://www.creastuces.com/des-styles-css-pour-optimiser-limpression-papier/)
- [ ] Ne pas utiliser de bouton social standard
- [ ] Limiter les fichiers de feuilles de style (<=10)
Expand Down
1 change: 1 addition & 0 deletions examples/simple-text-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"lhei:bp_0095": "node lighthouse-plugin-ecoindex/cli/index.js collect -u https://spie.com/en/journalists/profile-key-figures/ -o json -o html --audit-category=lighthouse-plugin-ecoindex",
"lhei:bp_0078": "node lighthouse-plugin-ecoindex/cli/index.js collect -u https://spie.com/en/journalists/profile-key-figures/ -o json -o html --audit-category=lighthouse-plugin-ecoindex",
"lhei:bp_0041": "node lighthouse-plugin-ecoindex/cli/index.js collect -u https://www.marmiton.org/ -o json -o html --audit-category=lighthouse-plugin-ecoindex",
"lhei:bp_Plugins": "node lighthouse-plugin-ecoindex/cli/index.js collect -u https://www.calameo.com/read/00650621105d0c8870e6d/ -o json -o html --audit-category=lighthouse-plugin-ecoindex",
"serve": "npx http-server -o reports --no-dotfiles"
},
"keywords": [],
Expand Down
30 changes: 30 additions & 0 deletions lighthouse-plugin-ecoindex/audits/bp/plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import { Audit } from 'lighthouse'
import Plugins from 'lighthouse/core/audits/seo/plugins.js'
import refsURLS from './refs-urls.js'

class PluginsCustomAudit extends Audit {
static get meta() {
const meta = Plugins.meta

return {
...meta,
id: 'bp-plugins',
title: '#TBD - Do not use plugins',
failureTitle: '#TBD - Plugin(s) founded.',
description: `Avoid using plugins (Flash Player, Java and Silverlight virtual machines, etc.) because they can be a heavy drain on resources (CPU and RAM). This is especially true with Adobe’s Flash Player, to such an extent that Apple decided to not install the technology on its mobile devices to maximize battery life. Favor standard technology such as HTML5 and ECMAScript.`,
// description: `[See #RWEB_4006](${refsURLS.rweb.bp_4006.en})`,
}
}

static audit(artifacts, context) {
return Plugins.audit(artifacts, context)
}
}

export default PluginsCustomAudit
8 changes: 8 additions & 0 deletions lighthouse-plugin-ecoindex/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export default {
{
path: 'lighthouse-plugin-ecoindex/audits/bp/uses-text-compression.js',
},
{
path: 'lighthouse-plugin-ecoindex/audits/bp/plugins.js',
},
],
groups: {
ecologic: {
Expand Down Expand Up @@ -138,6 +141,11 @@ export default {
weight: 0,
group: 'best-practices',
},
{
id: 'bp-plugins',
weight: 0,
group: 'best-practices',
},
{ id: 'bp-thegreenwebfoundation', weight: 0, group: 'other-practices' },
],
},
Expand Down

0 comments on commit b72edca

Please sign in to comment.