@elementor/editor-audits 4.4.0-1079 → 4.4.0-1081
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +278 -178
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +275 -175
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
- package/src/audits/google-consent-mode.ts +68 -0
- package/src/register-audits.ts +2 -0
- package/src/types.ts +2 -0
- package/src/utils/fetch-rendered-html.ts +24 -0
- package/src/utils/scan-consent-signals.ts +19 -0
package/dist/index.js
CHANGED
|
@@ -141,8 +141,8 @@ async function requestPageContext(documentId, attachmentIds, allowNonceRetry) {
|
|
|
141
141
|
|
|
142
142
|
// src/registry.ts
|
|
143
143
|
var registry = /* @__PURE__ */ new Map();
|
|
144
|
-
function registerAudit(
|
|
145
|
-
registry.set(
|
|
144
|
+
function registerAudit(audit23) {
|
|
145
|
+
registry.set(audit23.id, audit23);
|
|
146
146
|
}
|
|
147
147
|
function getRegisteredAudits() {
|
|
148
148
|
return Array.from(registry.values());
|
|
@@ -179,8 +179,8 @@ var CATEGORY_LABELS = {
|
|
|
179
179
|
var import_i18n2 = require("@wordpress/i18n");
|
|
180
180
|
|
|
181
181
|
// src/utils/is-scored-audit.ts
|
|
182
|
-
function isScoredAudit(
|
|
183
|
-
return
|
|
182
|
+
function isScoredAudit(audit23) {
|
|
183
|
+
return audit23.weight > 0;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
// src/utils/sort-failed-audits.ts
|
|
@@ -236,8 +236,8 @@ function auditStatusDisplayCounts(report) {
|
|
|
236
236
|
let pass = 0;
|
|
237
237
|
let skipped = 0;
|
|
238
238
|
let totalViolations = 0;
|
|
239
|
-
for (const { audit:
|
|
240
|
-
if (!isScoredAudit(
|
|
239
|
+
for (const { audit: audit23, result } of report.auditResults) {
|
|
240
|
+
if (!isScoredAudit(audit23)) {
|
|
241
241
|
continue;
|
|
242
242
|
}
|
|
243
243
|
switch (result.status) {
|
|
@@ -287,16 +287,16 @@ function computeReport(documentId, results) {
|
|
|
287
287
|
const accumulators = Object.fromEntries(
|
|
288
288
|
ALL_CATEGORIES.map((c) => [c, { totalWeight: 0, passedWeight: 0, total: 0, failed: 0 }])
|
|
289
289
|
);
|
|
290
|
-
for (const { audit:
|
|
290
|
+
for (const { audit: audit23, result } of results) {
|
|
291
291
|
if (result.status === "skipped") {
|
|
292
292
|
continue;
|
|
293
293
|
}
|
|
294
|
-
for (const category of
|
|
294
|
+
for (const category of audit23.categories) {
|
|
295
295
|
const acc = accumulators[category];
|
|
296
296
|
acc.total++;
|
|
297
|
-
acc.totalWeight +=
|
|
297
|
+
acc.totalWeight += audit23.weight;
|
|
298
298
|
if (result.status === "pass") {
|
|
299
|
-
acc.passedWeight +=
|
|
299
|
+
acc.passedWeight += audit23.weight;
|
|
300
300
|
} else {
|
|
301
301
|
acc.failed++;
|
|
302
302
|
}
|
|
@@ -485,10 +485,10 @@ async function runPageAudit(documentId) {
|
|
|
485
485
|
const ctx = { documentId, elements, pageContext, kit };
|
|
486
486
|
const registered = getRegisteredAudits();
|
|
487
487
|
const auditResults = await Promise.all(
|
|
488
|
-
registered.map(async (
|
|
489
|
-
const { evaluate: _evaluate, ...meta } =
|
|
488
|
+
registered.map(async (audit23) => {
|
|
489
|
+
const { evaluate: _evaluate, ...meta } = audit23;
|
|
490
490
|
try {
|
|
491
|
-
const result = await
|
|
491
|
+
const result = await audit23.evaluate(ctx);
|
|
492
492
|
return { audit: meta, result };
|
|
493
493
|
} catch (error) {
|
|
494
494
|
const reason = error instanceof Error ? error.message : "unknown-error";
|
|
@@ -976,13 +976,13 @@ function ViolationIcon({ violation, widgetIcon }) {
|
|
|
976
976
|
function SkipReasonTooltip({ reason }) {
|
|
977
977
|
return /* @__PURE__ */ React11.createElement(import_ui10.Tooltip, { title: reason, placement: "top" }, /* @__PURE__ */ React11.createElement(import_ui10.Box, { "aria-label": reason, component: "span", sx: { display: "inline-flex", alignItems: "center" } }, /* @__PURE__ */ React11.createElement(import_icons7.HelpIcon, { fontSize: "small", color: "action" })));
|
|
978
978
|
}
|
|
979
|
-
function StatusIndicator({ audit:
|
|
979
|
+
function StatusIndicator({ audit: audit23, violations }) {
|
|
980
980
|
if (violations) {
|
|
981
|
-
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, isScoredAudit(
|
|
981
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, isScoredAudit(audit23) && /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", color: "text.secondary", fontWeight: "bold" }, violations.length), /* @__PURE__ */ React11.createElement(SeverityIcon, { severity: audit23.severity }));
|
|
982
982
|
}
|
|
983
983
|
return /* @__PURE__ */ React11.createElement(import_icons7.CheckIcon, { fontSize: "small", color: "success" });
|
|
984
984
|
}
|
|
985
|
-
function ViolationRow({ audit:
|
|
985
|
+
function ViolationRow({ audit: audit23, skipReason, violations }) {
|
|
986
986
|
const [expanded, setExpanded] = (0, import_react4.useState)(false);
|
|
987
987
|
const toggleExpanded = () => setExpanded((value) => !value);
|
|
988
988
|
return /* @__PURE__ */ React11.createElement(import_ui10.Box, { sx: { borderBottom: 1, borderColor: "divider", paddingBlock: 0.5 } }, /* @__PURE__ */ React11.createElement(import_ui10.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, /* @__PURE__ */ React11.createElement(
|
|
@@ -998,8 +998,8 @@ function ViolationRow({ audit: audit22, skipReason, violations }) {
|
|
|
998
998
|
},
|
|
999
999
|
onClick: toggleExpanded
|
|
1000
1000
|
},
|
|
1001
|
-
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "body2", sx: { flex: 1 } },
|
|
1002
|
-
!skipReason && /* @__PURE__ */ React11.createElement(StatusIndicator, { audit:
|
|
1001
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "body2", sx: { flex: 1 } }, audit23.title),
|
|
1002
|
+
!skipReason && /* @__PURE__ */ React11.createElement(StatusIndicator, { audit: audit23, violations })
|
|
1003
1003
|
), skipReason && /* @__PURE__ */ React11.createElement(SkipReasonTooltip, { reason: skipReason }), /* @__PURE__ */ React11.createElement(
|
|
1004
1004
|
import_ui10.IconButton,
|
|
1005
1005
|
{
|
|
@@ -1025,7 +1025,7 @@ function ViolationRow({ audit: audit22, skipReason, violations }) {
|
|
|
1025
1025
|
icon: /* @__PURE__ */ React11.createElement(import_icons7.AlertCircleIcon, { fontSize: "small", color: "secondary", "aria-hidden": true })
|
|
1026
1026
|
},
|
|
1027
1027
|
/* @__PURE__ */ React11.createElement(import_ui10.AlertTitle, null, /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.primary", fontWeight: "bold" }, (0, import_i18n11.__)("What's the issue", "elementor"))),
|
|
1028
|
-
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.secondary" },
|
|
1028
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.secondary" }, audit23.description)
|
|
1029
1029
|
), /* @__PURE__ */ React11.createElement(
|
|
1030
1030
|
import_ui10.Alert,
|
|
1031
1031
|
{
|
|
@@ -1034,7 +1034,7 @@ function ViolationRow({ audit: audit22, skipReason, violations }) {
|
|
|
1034
1034
|
icon: /* @__PURE__ */ React11.createElement(import_icons7.BulbIcon, { fontSize: "small", color: "info", "aria-hidden": true })
|
|
1035
1035
|
},
|
|
1036
1036
|
/* @__PURE__ */ React11.createElement(import_ui10.AlertTitle, null, /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.primary", fontWeight: "bold" }, (0, import_i18n11.__)("How to resolve", "elementor"))),
|
|
1037
|
-
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.secondary" },
|
|
1037
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.secondary" }, audit23.fixHint)
|
|
1038
1038
|
)), violations && violations.length > 0 && /* @__PURE__ */ React11.createElement(import_ui10.Box, { role: "list", sx: { paddingBlockEnd: 1, paddingInlineStart: 2 } }, violations.map((violation, idx) => {
|
|
1039
1039
|
const widgetIcon = violation.elementId ? (0, import_editor_elements4.getElementIcon)(violation.elementId) : null;
|
|
1040
1040
|
const elementTitle = violation.elementId ? (0, import_editor_elements4.getElementTitle)(violation.elementId) : null;
|
|
@@ -1168,17 +1168,17 @@ var import_i18n14 = require("@wordpress/i18n");
|
|
|
1168
1168
|
var ALL_SEVERITIES = ["error", "warning", "info"];
|
|
1169
1169
|
function countSeverities(report, category) {
|
|
1170
1170
|
const counts = { error: 0, warning: 0, info: 0 };
|
|
1171
|
-
for (const { audit:
|
|
1171
|
+
for (const { audit: audit23, result } of report.auditResults) {
|
|
1172
1172
|
if (result.status !== "fail") {
|
|
1173
1173
|
continue;
|
|
1174
1174
|
}
|
|
1175
|
-
if (category && !
|
|
1175
|
+
if (category && !audit23.categories.includes(category)) {
|
|
1176
1176
|
continue;
|
|
1177
1177
|
}
|
|
1178
|
-
if (!isScoredAudit(
|
|
1178
|
+
if (!isScoredAudit(audit23)) {
|
|
1179
1179
|
continue;
|
|
1180
1180
|
}
|
|
1181
|
-
counts[
|
|
1181
|
+
counts[audit23.severity] += result.violations.length;
|
|
1182
1182
|
}
|
|
1183
1183
|
return counts;
|
|
1184
1184
|
}
|
|
@@ -1989,8 +1989,107 @@ var audit5 = {
|
|
|
1989
1989
|
}
|
|
1990
1990
|
};
|
|
1991
1991
|
|
|
1992
|
-
// src/audits/
|
|
1992
|
+
// src/audits/google-consent-mode.ts
|
|
1993
1993
|
var import_i18n28 = require("@wordpress/i18n");
|
|
1994
|
+
|
|
1995
|
+
// src/utils/fetch-rendered-html.ts
|
|
1996
|
+
var FETCH_TIMEOUT_MS = 1e4;
|
|
1997
|
+
async function fetchRenderedHtml(url) {
|
|
1998
|
+
if (!url) {
|
|
1999
|
+
return null;
|
|
2000
|
+
}
|
|
2001
|
+
const timeoutController = new AbortController();
|
|
2002
|
+
const timeoutId = setTimeout(() => timeoutController.abort(), FETCH_TIMEOUT_MS);
|
|
2003
|
+
try {
|
|
2004
|
+
const response = await fetch(url, { credentials: "omit", signal: timeoutController.signal });
|
|
2005
|
+
if (!response.ok) {
|
|
2006
|
+
return null;
|
|
2007
|
+
}
|
|
2008
|
+
return await response.text();
|
|
2009
|
+
} catch {
|
|
2010
|
+
return null;
|
|
2011
|
+
} finally {
|
|
2012
|
+
clearTimeout(timeoutId);
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
// src/utils/scan-consent-signals.ts
|
|
2017
|
+
var GOOGLE_TRACKING_PATTERNS = [
|
|
2018
|
+
/googletagmanager\.com\/gtag\/js\?id=(G|AW)-/,
|
|
2019
|
+
/googletagmanager\.com\/gtm\.js/,
|
|
2020
|
+
/\bGTM-[A-Z0-9]+\b/,
|
|
2021
|
+
/gtag\(\s*['"]config['"]\s*,\s*['"](G|AW)-/
|
|
2022
|
+
];
|
|
2023
|
+
var CONSENT_DEFAULT_PATTERNS = [
|
|
2024
|
+
/gtag\(\s*['"]consent['"]\s*,\s*['"]default['"]/,
|
|
2025
|
+
/dataLayer\.push\(\s*\[\s*['"]consent['"]\s*,\s*['"]default['"]/
|
|
2026
|
+
];
|
|
2027
|
+
function hasGoogleTracking(html) {
|
|
2028
|
+
return GOOGLE_TRACKING_PATTERNS.some((pattern) => pattern.test(html));
|
|
2029
|
+
}
|
|
2030
|
+
function hasConsentDefaultCall(html) {
|
|
2031
|
+
return CONSENT_DEFAULT_PATTERNS.some((pattern) => pattern.test(html));
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
// src/audits/google-consent-mode.ts
|
|
2035
|
+
var audit6 = {
|
|
2036
|
+
id: "audits/google-consent-mode",
|
|
2037
|
+
title: (0, import_i18n28.__)("Google Consent Mode", "elementor"),
|
|
2038
|
+
description: (0, import_i18n28.__)(
|
|
2039
|
+
"Google Analytics, Ads, or Tag Manager are running on this site and may not receive a consent signal, which risks losing conversion/analytics data and compliance exposure.",
|
|
2040
|
+
"elementor"
|
|
2041
|
+
),
|
|
2042
|
+
fixHint: (0, import_i18n28.__)(
|
|
2043
|
+
"Turn on Google Consent Mode in your cookie consent plugin so Google tags respect visitor consent choices.",
|
|
2044
|
+
"elementor"
|
|
2045
|
+
),
|
|
2046
|
+
categories: ["compliance"],
|
|
2047
|
+
severity: "warning",
|
|
2048
|
+
weight: 1,
|
|
2049
|
+
evaluate: async (ctx) => {
|
|
2050
|
+
if (!ctx.pageContext.frontend_url) {
|
|
2051
|
+
return { status: "skipped", reason: (0, import_i18n28.__)("Page is not published.", "elementor") };
|
|
2052
|
+
}
|
|
2053
|
+
const html = await fetchRenderedHtml(ctx.pageContext.frontend_url);
|
|
2054
|
+
if (!html) {
|
|
2055
|
+
return { status: "skipped", reason: (0, import_i18n28.__)("Could not fetch the published page.", "elementor") };
|
|
2056
|
+
}
|
|
2057
|
+
if (!hasGoogleTracking(html)) {
|
|
2058
|
+
return { status: "skipped", reason: (0, import_i18n28.__)("No Google tracking product detected.", "elementor") };
|
|
2059
|
+
}
|
|
2060
|
+
if (hasConsentDefaultCall(html)) {
|
|
2061
|
+
return { status: "pass" };
|
|
2062
|
+
}
|
|
2063
|
+
const label = (0, import_i18n28.__)("No Google Consent Mode signal was found on the page.", "elementor");
|
|
2064
|
+
const isCookiezReady = ctx.pageContext.cookiez_plugin_installed && ctx.pageContext.cookiez_plugin_active;
|
|
2065
|
+
if (isCookiezReady) {
|
|
2066
|
+
return {
|
|
2067
|
+
status: "fail",
|
|
2068
|
+
violations: [
|
|
2069
|
+
{
|
|
2070
|
+
auditId: audit6.id,
|
|
2071
|
+
label,
|
|
2072
|
+
ctaLabel: (0, import_i18n28.__)("Enable", "elementor"),
|
|
2073
|
+
externalUrl: ctx.pageContext.cookiez_consent_mode_settings_url
|
|
2074
|
+
}
|
|
2075
|
+
]
|
|
2076
|
+
};
|
|
2077
|
+
}
|
|
2078
|
+
return {
|
|
2079
|
+
status: "fail",
|
|
2080
|
+
violations: [
|
|
2081
|
+
{
|
|
2082
|
+
auditId: audit6.id,
|
|
2083
|
+
label,
|
|
2084
|
+
externalUrl: ctx.pageContext.cookiez_plugin_action_url
|
|
2085
|
+
}
|
|
2086
|
+
]
|
|
2087
|
+
};
|
|
2088
|
+
}
|
|
2089
|
+
};
|
|
2090
|
+
|
|
2091
|
+
// src/audits/heading-structure.ts
|
|
2092
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
1994
2093
|
var HEADING_LEVELS = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
1995
2094
|
var HEADING_CONTROLS_REGISTRY = {
|
|
1996
2095
|
// Core
|
|
@@ -2166,47 +2265,47 @@ function extractPageHeadings(tree) {
|
|
|
2166
2265
|
});
|
|
2167
2266
|
return headings;
|
|
2168
2267
|
}
|
|
2169
|
-
var
|
|
2268
|
+
var audit7 = {
|
|
2170
2269
|
id: "audits/heading-structure",
|
|
2171
|
-
title: (0,
|
|
2172
|
-
description: (0,
|
|
2173
|
-
fixHint: (0,
|
|
2270
|
+
title: (0, import_i18n29.__)("Heading structure", "elementor"),
|
|
2271
|
+
description: (0, import_i18n29.__)("Pages should have exactly one H1 and a non-skipping heading order.", "elementor"),
|
|
2272
|
+
fixHint: (0, import_i18n29.__)("Ensure your page has one H1 and that heading levels do not skip (no H2 \u2192 H4).", "elementor"),
|
|
2174
2273
|
categories: ["seo", "accessibility"],
|
|
2175
2274
|
severity: "error",
|
|
2176
2275
|
weight: 10,
|
|
2177
2276
|
evaluate: (ctx) => {
|
|
2178
2277
|
if (ctx.elements.tree.length === 0) {
|
|
2179
|
-
return { status: "skipped", reason: (0,
|
|
2278
|
+
return { status: "skipped", reason: (0, import_i18n29.__)("No elements", "elementor") };
|
|
2180
2279
|
}
|
|
2181
2280
|
const headings = extractPageHeadings(ctx.elements.tree);
|
|
2182
2281
|
const violations = [];
|
|
2183
2282
|
if (headings.length === 0) {
|
|
2184
2283
|
violations.push({
|
|
2185
|
-
auditId:
|
|
2186
|
-
label: (0,
|
|
2284
|
+
auditId: audit7.id,
|
|
2285
|
+
label: (0, import_i18n29.__)("No headings found on the page.", "elementor")
|
|
2187
2286
|
});
|
|
2188
2287
|
} else {
|
|
2189
2288
|
const h1Count = headings.filter((h) => h.level === 1).length;
|
|
2190
2289
|
if (h1Count === 0) {
|
|
2191
|
-
violations.push({ auditId:
|
|
2290
|
+
violations.push({ auditId: audit7.id, label: (0, import_i18n29.__)("No H1 on the page.", "elementor") });
|
|
2192
2291
|
}
|
|
2193
2292
|
if (h1Count > 1) {
|
|
2194
2293
|
headings.filter((h) => h.level === 1).slice(1).forEach(
|
|
2195
2294
|
(h) => violations.push({
|
|
2196
|
-
auditId:
|
|
2295
|
+
auditId: audit7.id,
|
|
2197
2296
|
elementId: h.elementId,
|
|
2198
2297
|
targetHint: "element-settings",
|
|
2199
|
-
label: (0,
|
|
2298
|
+
label: (0, import_i18n29.__)("More than one H1 on the page.", "elementor")
|
|
2200
2299
|
})
|
|
2201
2300
|
);
|
|
2202
2301
|
}
|
|
2203
2302
|
for (let i = 1; i < headings.length; i++) {
|
|
2204
2303
|
if (headings[i].level - headings[i - 1].level > 1) {
|
|
2205
2304
|
violations.push({
|
|
2206
|
-
auditId:
|
|
2305
|
+
auditId: audit7.id,
|
|
2207
2306
|
elementId: headings[i].elementId,
|
|
2208
2307
|
targetHint: "element-settings",
|
|
2209
|
-
label: (0,
|
|
2308
|
+
label: (0, import_i18n29.__)("Heading level skipped.", "elementor")
|
|
2210
2309
|
});
|
|
2211
2310
|
}
|
|
2212
2311
|
}
|
|
@@ -2216,33 +2315,33 @@ var audit6 = {
|
|
|
2216
2315
|
};
|
|
2217
2316
|
|
|
2218
2317
|
// src/audits/hidden-elements.ts
|
|
2219
|
-
var
|
|
2318
|
+
var import_i18n30 = require("@wordpress/i18n");
|
|
2220
2319
|
function isHiddenOnAllDevices(settings) {
|
|
2221
2320
|
return Boolean(settings.hide_desktop) && Boolean(settings.hide_tablet) && Boolean(settings.hide_mobile);
|
|
2222
2321
|
}
|
|
2223
|
-
var
|
|
2322
|
+
var audit8 = {
|
|
2224
2323
|
id: "audits/hidden-elements",
|
|
2225
|
-
title: (0,
|
|
2226
|
-
description: (0,
|
|
2324
|
+
title: (0, import_i18n30.__)("Hidden elements", "elementor"),
|
|
2325
|
+
description: (0, import_i18n30.__)(
|
|
2227
2326
|
"Elements hidden on all devices simultaneously are effectively dead code in the page tree.",
|
|
2228
2327
|
"elementor"
|
|
2229
2328
|
),
|
|
2230
|
-
fixHint: (0,
|
|
2329
|
+
fixHint: (0, import_i18n30.__)("Remove the element or make it visible on at least one device breakpoint.", "elementor"),
|
|
2231
2330
|
categories: ["best-practices", "performance"],
|
|
2232
2331
|
severity: "info",
|
|
2233
2332
|
weight: 3,
|
|
2234
2333
|
evaluate: (ctx) => {
|
|
2235
2334
|
if (ctx.elements.tree.length === 0) {
|
|
2236
|
-
return { status: "skipped", reason: (0,
|
|
2335
|
+
return { status: "skipped", reason: (0, import_i18n30.__)("No elements", "elementor") };
|
|
2237
2336
|
}
|
|
2238
2337
|
const violations = [];
|
|
2239
2338
|
walkElements(ctx.elements.tree, (node) => {
|
|
2240
2339
|
if (isHiddenOnAllDevices(node.settings)) {
|
|
2241
2340
|
violations.push({
|
|
2242
|
-
auditId:
|
|
2341
|
+
auditId: audit8.id,
|
|
2243
2342
|
elementId: node.id,
|
|
2244
2343
|
targetHint: "element-settings",
|
|
2245
|
-
label: (0,
|
|
2344
|
+
label: (0, import_i18n30.__)("Element is hidden on all devices.", "elementor")
|
|
2246
2345
|
});
|
|
2247
2346
|
}
|
|
2248
2347
|
});
|
|
@@ -2251,7 +2350,7 @@ var audit7 = {
|
|
|
2251
2350
|
};
|
|
2252
2351
|
|
|
2253
2352
|
// src/audits/images-alt-text.ts
|
|
2254
|
-
var
|
|
2353
|
+
var import_i18n31 = require("@wordpress/i18n");
|
|
2255
2354
|
|
|
2256
2355
|
// src/utils/image-alt.ts
|
|
2257
2356
|
function hasMeaningfulAlt(media, pageContext) {
|
|
@@ -2269,17 +2368,17 @@ function isImageSourcePresent(media) {
|
|
|
2269
2368
|
}
|
|
2270
2369
|
|
|
2271
2370
|
// src/audits/images-alt-text.ts
|
|
2272
|
-
var
|
|
2371
|
+
var audit9 = {
|
|
2273
2372
|
id: "audits/images-alt-text",
|
|
2274
|
-
title: (0,
|
|
2275
|
-
description: (0,
|
|
2276
|
-
fixHint: (0,
|
|
2373
|
+
title: (0, import_i18n31.__)("Images alt text", "elementor"),
|
|
2374
|
+
description: (0, import_i18n31.__)("Every image needs a meaningful alt attribute for screen readers and image-search.", "elementor"),
|
|
2375
|
+
fixHint: (0, import_i18n31.__)("Open the image's settings and add an Alt Text describing the image.", "elementor"),
|
|
2277
2376
|
categories: ["seo", "accessibility"],
|
|
2278
2377
|
severity: "error",
|
|
2279
2378
|
weight: 10,
|
|
2280
2379
|
evaluate: (ctx) => {
|
|
2281
2380
|
if (!hasPageImages(ctx.elements.tree)) {
|
|
2282
|
-
return { status: "skipped", reason: (0,
|
|
2381
|
+
return { status: "skipped", reason: (0, import_i18n31.__)("No images", "elementor") };
|
|
2283
2382
|
}
|
|
2284
2383
|
const violations = [];
|
|
2285
2384
|
const failedWidgetIds = /* @__PURE__ */ new Set();
|
|
@@ -2292,10 +2391,10 @@ var audit8 = {
|
|
|
2292
2391
|
if (!failedWidgetIds.has(node.id)) {
|
|
2293
2392
|
failedWidgetIds.add(node.id);
|
|
2294
2393
|
violations.push({
|
|
2295
|
-
auditId:
|
|
2394
|
+
auditId: audit9.id,
|
|
2296
2395
|
elementId: node.id,
|
|
2297
2396
|
targetHint: "element-settings",
|
|
2298
|
-
label: (0,
|
|
2397
|
+
label: (0, import_i18n31.__)("Image is missing alt text.", "elementor"),
|
|
2299
2398
|
externalUrl: ctx.pageContext.ally_plugin_url
|
|
2300
2399
|
});
|
|
2301
2400
|
}
|
|
@@ -2305,20 +2404,20 @@ var audit8 = {
|
|
|
2305
2404
|
};
|
|
2306
2405
|
|
|
2307
2406
|
// src/audits/images-too-large.ts
|
|
2308
|
-
var
|
|
2407
|
+
var import_i18n32 = require("@wordpress/i18n");
|
|
2309
2408
|
var SIZE_THRESHOLD_BYTES = 500 * 1024;
|
|
2310
2409
|
var BYTES_PER_KB = 1024;
|
|
2311
|
-
var
|
|
2410
|
+
var audit10 = {
|
|
2312
2411
|
id: "audits/images-too-large",
|
|
2313
|
-
title: (0,
|
|
2314
|
-
description: (0,
|
|
2315
|
-
fixHint: (0,
|
|
2412
|
+
title: (0, import_i18n32.__)("Oversized images", "elementor"),
|
|
2413
|
+
description: (0, import_i18n32.__)("Large image files slow down the page.", "elementor"),
|
|
2414
|
+
fixHint: (0, import_i18n32.__)("Replace the image with a smaller version or enable image optimization.", "elementor"),
|
|
2316
2415
|
categories: ["performance"],
|
|
2317
2416
|
severity: "warning",
|
|
2318
2417
|
weight: 7,
|
|
2319
2418
|
evaluate: (ctx) => {
|
|
2320
2419
|
if (!hasPageImages(ctx.elements.tree)) {
|
|
2321
|
-
return { status: "skipped", reason: (0,
|
|
2420
|
+
return { status: "skipped", reason: (0, import_i18n32.__)("No images", "elementor") };
|
|
2322
2421
|
}
|
|
2323
2422
|
const widgetMaxKb = /* @__PURE__ */ new Map();
|
|
2324
2423
|
let oversizedImageCount = 0;
|
|
@@ -2337,12 +2436,12 @@ var audit9 = {
|
|
|
2337
2436
|
widgetMaxKb.set(node.id, Math.max(currentMax, kb));
|
|
2338
2437
|
});
|
|
2339
2438
|
const violations = Array.from(widgetMaxKb.entries()).map(([elementId, kb]) => ({
|
|
2340
|
-
auditId:
|
|
2439
|
+
auditId: audit10.id,
|
|
2341
2440
|
elementId,
|
|
2342
2441
|
targetHint: "element-settings",
|
|
2343
|
-
label: (0,
|
|
2442
|
+
label: (0, import_i18n32.sprintf)(
|
|
2344
2443
|
/* translators: %d is the image file size in kilobytes. */
|
|
2345
|
-
(0,
|
|
2444
|
+
(0, import_i18n32.__)("Image is %d KB (over 500 KB).", "elementor"),
|
|
2346
2445
|
kb
|
|
2347
2446
|
),
|
|
2348
2447
|
externalUrl: ctx.pageContext.image_optimization_plugin_url
|
|
@@ -2352,21 +2451,21 @@ var audit9 = {
|
|
|
2352
2451
|
};
|
|
2353
2452
|
|
|
2354
2453
|
// src/audits/nested-boxed-containers.ts
|
|
2355
|
-
var
|
|
2454
|
+
var import_i18n33 = require("@wordpress/i18n");
|
|
2356
2455
|
function isBoxed(settings) {
|
|
2357
2456
|
return settings.content_width === "boxed";
|
|
2358
2457
|
}
|
|
2359
|
-
var
|
|
2458
|
+
var audit11 = {
|
|
2360
2459
|
id: "audits/nested-boxed-containers",
|
|
2361
|
-
title: (0,
|
|
2362
|
-
description: (0,
|
|
2363
|
-
fixHint: (0,
|
|
2460
|
+
title: (0, import_i18n33.__)("Boxed container nested inside a boxed parent", "elementor"),
|
|
2461
|
+
description: (0, import_i18n33.__)("An inner container does not need to be boxed when its parent already is.", "elementor"),
|
|
2462
|
+
fixHint: (0, import_i18n33.__)("Change the inner container's content width to Full Width.", "elementor"),
|
|
2364
2463
|
categories: ["best-practices", "performance"],
|
|
2365
2464
|
severity: "info",
|
|
2366
2465
|
weight: 5,
|
|
2367
2466
|
evaluate: (ctx) => {
|
|
2368
2467
|
if (ctx.elements.tree.length === 0) {
|
|
2369
|
-
return { status: "skipped", reason: (0,
|
|
2468
|
+
return { status: "skipped", reason: (0, import_i18n33.__)("No elements", "elementor") };
|
|
2370
2469
|
}
|
|
2371
2470
|
const violations = [];
|
|
2372
2471
|
walkElements(ctx.elements.tree, (node, parents) => {
|
|
@@ -2376,10 +2475,10 @@ var audit10 = {
|
|
|
2376
2475
|
const nearestContainerAncestor = [...parents].reverse().find((p) => p.elType === "container");
|
|
2377
2476
|
if (nearestContainerAncestor && isBoxed(nearestContainerAncestor.settings)) {
|
|
2378
2477
|
violations.push({
|
|
2379
|
-
auditId:
|
|
2478
|
+
auditId: audit11.id,
|
|
2380
2479
|
elementId: node.id,
|
|
2381
2480
|
targetHint: "element-settings",
|
|
2382
|
-
label: (0,
|
|
2481
|
+
label: (0, import_i18n33.__)("Nested boxed container.", "elementor")
|
|
2383
2482
|
});
|
|
2384
2483
|
}
|
|
2385
2484
|
});
|
|
@@ -2388,12 +2487,12 @@ var audit10 = {
|
|
|
2388
2487
|
};
|
|
2389
2488
|
|
|
2390
2489
|
// src/audits/page-excerpt.ts
|
|
2391
|
-
var
|
|
2392
|
-
var
|
|
2490
|
+
var import_i18n34 = require("@wordpress/i18n");
|
|
2491
|
+
var audit12 = {
|
|
2393
2492
|
id: "audits/page-excerpt",
|
|
2394
|
-
title: (0,
|
|
2395
|
-
description: (0,
|
|
2396
|
-
fixHint: (0,
|
|
2493
|
+
title: (0, import_i18n34.__)("Page excerpt", "elementor"),
|
|
2494
|
+
description: (0, import_i18n34.__)("A descriptive excerpt helps search engines and previews summarize the page.", "elementor"),
|
|
2495
|
+
fixHint: (0, import_i18n34.__)("Open Page Settings and write a short excerpt.", "elementor"),
|
|
2397
2496
|
categories: ["seo"],
|
|
2398
2497
|
severity: "warning",
|
|
2399
2498
|
weight: 5,
|
|
@@ -2405,8 +2504,8 @@ var audit11 = {
|
|
|
2405
2504
|
status: "fail",
|
|
2406
2505
|
violations: [
|
|
2407
2506
|
{
|
|
2408
|
-
auditId:
|
|
2409
|
-
label: (0,
|
|
2507
|
+
auditId: audit12.id,
|
|
2508
|
+
label: (0, import_i18n34.__)("Page has no excerpt.", "elementor"),
|
|
2410
2509
|
targetHint: "page-settings",
|
|
2411
2510
|
angieFix: true
|
|
2412
2511
|
}
|
|
@@ -2416,12 +2515,12 @@ var audit11 = {
|
|
|
2416
2515
|
};
|
|
2417
2516
|
|
|
2418
2517
|
// src/audits/page-featured-image.ts
|
|
2419
|
-
var
|
|
2420
|
-
var
|
|
2518
|
+
var import_i18n35 = require("@wordpress/i18n");
|
|
2519
|
+
var audit13 = {
|
|
2421
2520
|
id: "audits/page-featured-image",
|
|
2422
|
-
title: (0,
|
|
2423
|
-
description: (0,
|
|
2424
|
-
fixHint: (0,
|
|
2521
|
+
title: (0, import_i18n35.__)("Page featured image", "elementor"),
|
|
2522
|
+
description: (0, import_i18n35.__)("Featured images are used by social shares and many themes for hero visuals.", "elementor"),
|
|
2523
|
+
fixHint: (0, import_i18n35.__)("Open Page Settings and set a featured image.", "elementor"),
|
|
2425
2524
|
categories: ["seo"],
|
|
2426
2525
|
severity: "info",
|
|
2427
2526
|
weight: 5,
|
|
@@ -2433,8 +2532,8 @@ var audit12 = {
|
|
|
2433
2532
|
status: "fail",
|
|
2434
2533
|
violations: [
|
|
2435
2534
|
{
|
|
2436
|
-
auditId:
|
|
2437
|
-
label: (0,
|
|
2535
|
+
auditId: audit13.id,
|
|
2536
|
+
label: (0, import_i18n35.__)("No featured image set.", "elementor"),
|
|
2438
2537
|
targetHint: "page-settings"
|
|
2439
2538
|
}
|
|
2440
2539
|
]
|
|
@@ -2443,13 +2542,13 @@ var audit12 = {
|
|
|
2443
2542
|
};
|
|
2444
2543
|
|
|
2445
2544
|
// src/audits/page-title.ts
|
|
2446
|
-
var
|
|
2545
|
+
var import_i18n36 = require("@wordpress/i18n");
|
|
2447
2546
|
var MAX_TITLE_LENGTH = 60;
|
|
2448
|
-
var
|
|
2547
|
+
var audit14 = {
|
|
2449
2548
|
id: "audits/page-title",
|
|
2450
|
-
title: (0,
|
|
2451
|
-
description: (0,
|
|
2452
|
-
fixHint: (0,
|
|
2549
|
+
title: (0, import_i18n36.__)("Page title", "elementor"),
|
|
2550
|
+
description: (0, import_i18n36.__)("Pages need a clear title for SEO and screen-reader navigation.", "elementor"),
|
|
2551
|
+
fixHint: (0, import_i18n36.__)("Open Page Settings and add a title.", "elementor"),
|
|
2453
2552
|
categories: ["seo"],
|
|
2454
2553
|
severity: "error",
|
|
2455
2554
|
weight: 10,
|
|
@@ -2460,8 +2559,8 @@ var audit13 = {
|
|
|
2460
2559
|
status: "fail",
|
|
2461
2560
|
violations: [
|
|
2462
2561
|
{
|
|
2463
|
-
auditId:
|
|
2464
|
-
label: (0,
|
|
2562
|
+
auditId: audit14.id,
|
|
2563
|
+
label: (0, import_i18n36.__)("Page has no title.", "elementor"),
|
|
2465
2564
|
targetHint: "page-settings",
|
|
2466
2565
|
angieFix: true
|
|
2467
2566
|
}
|
|
@@ -2473,8 +2572,8 @@ var audit13 = {
|
|
|
2473
2572
|
status: "fail",
|
|
2474
2573
|
violations: [
|
|
2475
2574
|
{
|
|
2476
|
-
auditId:
|
|
2477
|
-
label: (0,
|
|
2575
|
+
auditId: audit14.id,
|
|
2576
|
+
label: (0, import_i18n36.__)("Page title is too long.", "elementor"),
|
|
2478
2577
|
targetHint: "page-settings",
|
|
2479
2578
|
angieFix: true
|
|
2480
2579
|
}
|
|
@@ -2486,7 +2585,7 @@ var audit13 = {
|
|
|
2486
2585
|
};
|
|
2487
2586
|
|
|
2488
2587
|
// src/audits/prefer-global-colors.ts
|
|
2489
|
-
var
|
|
2588
|
+
var import_i18n37 = require("@wordpress/i18n");
|
|
2490
2589
|
|
|
2491
2590
|
// src/utils/collect-hardcoded-colors.ts
|
|
2492
2591
|
var RESERVED_SETTING_KEYS = /* @__PURE__ */ new Set(["__globals__", "__dynamic__"]);
|
|
@@ -2552,20 +2651,20 @@ function findMatchingGlobalByValue(value, globals) {
|
|
|
2552
2651
|
}
|
|
2553
2652
|
|
|
2554
2653
|
// src/audits/prefer-global-colors.ts
|
|
2555
|
-
var
|
|
2654
|
+
var audit15 = {
|
|
2556
2655
|
id: "audits/prefer-global-colors",
|
|
2557
|
-
title: (0,
|
|
2558
|
-
description: (0,
|
|
2559
|
-
fixHint: (0,
|
|
2656
|
+
title: (0, import_i18n37.__)("Prefer global colors", "elementor"),
|
|
2657
|
+
description: (0, import_i18n37.__)("Global colors make the design consistent and easy to update site-wide.", "elementor"),
|
|
2658
|
+
fixHint: (0, import_i18n37.__)("Replace the hard-coded value with the matching global color.", "elementor"),
|
|
2560
2659
|
categories: ["best-practices"],
|
|
2561
2660
|
severity: "info",
|
|
2562
2661
|
weight: 3,
|
|
2563
2662
|
evaluate: (ctx) => {
|
|
2564
2663
|
if (ctx.elements.tree.length === 0) {
|
|
2565
|
-
return { status: "skipped", reason: (0,
|
|
2664
|
+
return { status: "skipped", reason: (0, import_i18n37.__)("No elements", "elementor") };
|
|
2566
2665
|
}
|
|
2567
2666
|
if (ctx.kit.globals.colors.length === 0) {
|
|
2568
|
-
return { status: "skipped", reason: (0,
|
|
2667
|
+
return { status: "skipped", reason: (0, import_i18n37.__)("No global colors", "elementor") };
|
|
2569
2668
|
}
|
|
2570
2669
|
const violations = [];
|
|
2571
2670
|
walkElements(ctx.elements.tree, (node) => {
|
|
@@ -2575,13 +2674,13 @@ var audit14 = {
|
|
|
2575
2674
|
continue;
|
|
2576
2675
|
}
|
|
2577
2676
|
violations.push({
|
|
2578
|
-
auditId:
|
|
2677
|
+
auditId: audit15.id,
|
|
2579
2678
|
elementId: node.id,
|
|
2580
2679
|
targetHint: "element-settings",
|
|
2581
2680
|
angieFix: true,
|
|
2582
|
-
label: (0,
|
|
2681
|
+
label: (0, import_i18n37.sprintf)(
|
|
2583
2682
|
/* translators: 1: hard-coded color value, 2: global color title. */
|
|
2584
|
-
(0,
|
|
2683
|
+
(0, import_i18n37.__)('replace "%1$s" with "%2$s" global color', "elementor"),
|
|
2585
2684
|
value,
|
|
2586
2685
|
global.title
|
|
2587
2686
|
)
|
|
@@ -2593,7 +2692,7 @@ var audit14 = {
|
|
|
2593
2692
|
};
|
|
2594
2693
|
|
|
2595
2694
|
// src/audits/prefer-global-fonts.ts
|
|
2596
|
-
var
|
|
2695
|
+
var import_i18n38 = require("@wordpress/i18n");
|
|
2597
2696
|
|
|
2598
2697
|
// src/utils/collect-hardcoded-fonts.ts
|
|
2599
2698
|
var RESERVED_SETTING_KEYS2 = /* @__PURE__ */ new Set(["__globals__", "__dynamic__"]);
|
|
@@ -2651,20 +2750,20 @@ function collectHardcodedFonts(settings, pathPrefix = "") {
|
|
|
2651
2750
|
}
|
|
2652
2751
|
|
|
2653
2752
|
// src/audits/prefer-global-fonts.ts
|
|
2654
|
-
var
|
|
2753
|
+
var audit16 = {
|
|
2655
2754
|
id: "audits/prefer-global-fonts",
|
|
2656
|
-
title: (0,
|
|
2657
|
-
description: (0,
|
|
2658
|
-
fixHint: (0,
|
|
2755
|
+
title: (0, import_i18n38.__)("Prefer global fonts", "elementor"),
|
|
2756
|
+
description: (0, import_i18n38.__)("Global fonts make the design consistent and easy to update site-wide.", "elementor"),
|
|
2757
|
+
fixHint: (0, import_i18n38.__)("Replace the hard-coded value with the matching global font.", "elementor"),
|
|
2659
2758
|
categories: ["best-practices", "performance"],
|
|
2660
2759
|
severity: "info",
|
|
2661
2760
|
weight: 3,
|
|
2662
2761
|
evaluate: (ctx) => {
|
|
2663
2762
|
if (ctx.elements.tree.length === 0) {
|
|
2664
|
-
return { status: "skipped", reason: (0,
|
|
2763
|
+
return { status: "skipped", reason: (0, import_i18n38.__)("No elements", "elementor") };
|
|
2665
2764
|
}
|
|
2666
2765
|
if (ctx.kit.globals.fonts.length === 0) {
|
|
2667
|
-
return { status: "skipped", reason: (0,
|
|
2766
|
+
return { status: "skipped", reason: (0, import_i18n38.__)("No global fonts", "elementor") };
|
|
2668
2767
|
}
|
|
2669
2768
|
const violations = [];
|
|
2670
2769
|
walkElements(ctx.elements.tree, (node) => {
|
|
@@ -2674,12 +2773,12 @@ var audit15 = {
|
|
|
2674
2773
|
continue;
|
|
2675
2774
|
}
|
|
2676
2775
|
violations.push({
|
|
2677
|
-
auditId:
|
|
2776
|
+
auditId: audit16.id,
|
|
2678
2777
|
elementId: node.id,
|
|
2679
2778
|
targetHint: "element-settings",
|
|
2680
|
-
label: (0,
|
|
2779
|
+
label: (0, import_i18n38.sprintf)(
|
|
2681
2780
|
/* translators: %s: global font title. */
|
|
2682
|
-
(0,
|
|
2781
|
+
(0, import_i18n38.__)('replace hardcoded typography with "%s" global font', "elementor"),
|
|
2683
2782
|
global.title
|
|
2684
2783
|
)
|
|
2685
2784
|
});
|
|
@@ -2690,15 +2789,15 @@ var audit15 = {
|
|
|
2690
2789
|
};
|
|
2691
2790
|
|
|
2692
2791
|
// src/audits/privacy-policy.ts
|
|
2693
|
-
var
|
|
2694
|
-
var
|
|
2792
|
+
var import_i18n39 = require("@wordpress/i18n");
|
|
2793
|
+
var audit17 = {
|
|
2695
2794
|
id: "audits/privacy-policy",
|
|
2696
|
-
title: (0,
|
|
2697
|
-
description: (0,
|
|
2795
|
+
title: (0, import_i18n39.__)("Privacy policy", "elementor"),
|
|
2796
|
+
description: (0, import_i18n39.__)(
|
|
2698
2797
|
"A privacy policy page is required by privacy regulations such as GDPR (EU) and CCPA (US).",
|
|
2699
2798
|
"elementor"
|
|
2700
2799
|
),
|
|
2701
|
-
fixHint: (0,
|
|
2800
|
+
fixHint: (0, import_i18n39.__)(
|
|
2702
2801
|
"Go to Settings > Privacy in the WordPress admin and assign a published privacy policy page.",
|
|
2703
2802
|
"elementor"
|
|
2704
2803
|
),
|
|
@@ -2713,10 +2812,10 @@ var audit16 = {
|
|
|
2713
2812
|
status: "fail",
|
|
2714
2813
|
violations: [
|
|
2715
2814
|
{
|
|
2716
|
-
auditId:
|
|
2717
|
-
label: (0,
|
|
2815
|
+
auditId: audit17.id,
|
|
2816
|
+
label: (0, import_i18n39.__)("No privacy policy page is set.", "elementor"),
|
|
2718
2817
|
externalUrl: ctx.pageContext.privacy_settings_url,
|
|
2719
|
-
ctaLabel: (0,
|
|
2818
|
+
ctaLabel: (0, import_i18n39.__)("Create", "elementor")
|
|
2720
2819
|
}
|
|
2721
2820
|
]
|
|
2722
2821
|
};
|
|
@@ -2724,15 +2823,15 @@ var audit16 = {
|
|
|
2724
2823
|
};
|
|
2725
2824
|
|
|
2726
2825
|
// src/audits/robots-noindex.ts
|
|
2727
|
-
var
|
|
2728
|
-
var
|
|
2826
|
+
var import_i18n40 = require("@wordpress/i18n");
|
|
2827
|
+
var audit18 = {
|
|
2729
2828
|
id: "audits/robots-noindex",
|
|
2730
|
-
title: (0,
|
|
2731
|
-
description: (0,
|
|
2829
|
+
title: (0, import_i18n40.__)("Search engine visibility", "elementor"),
|
|
2830
|
+
description: (0, import_i18n40.__)(
|
|
2732
2831
|
"When search engine visibility is checked in WordPress Settings -> Reading -> Search Engine Visibility, search engines are discouraged from indexing the website.",
|
|
2733
2832
|
"elementor"
|
|
2734
2833
|
),
|
|
2735
|
-
fixHint: (0,
|
|
2834
|
+
fixHint: (0, import_i18n40.__)(
|
|
2736
2835
|
'Go to Settings \u2192 Reading in the WordPress admin and uncheck "Discourage search engines from indexing this site" when the website should be indexed.',
|
|
2737
2836
|
"elementor"
|
|
2738
2837
|
),
|
|
@@ -2747,8 +2846,8 @@ var audit17 = {
|
|
|
2747
2846
|
status: "fail",
|
|
2748
2847
|
violations: [
|
|
2749
2848
|
{
|
|
2750
|
-
auditId:
|
|
2751
|
-
label: (0,
|
|
2849
|
+
auditId: audit18.id,
|
|
2850
|
+
label: (0, import_i18n40.__)("Search engines are discouraged from indexing this website.", "elementor"),
|
|
2752
2851
|
externalUrl: ctx.pageContext.reading_settings_url
|
|
2753
2852
|
}
|
|
2754
2853
|
]
|
|
@@ -2757,15 +2856,15 @@ var audit17 = {
|
|
|
2757
2856
|
};
|
|
2758
2857
|
|
|
2759
2858
|
// src/audits/scan-for-cookies.ts
|
|
2760
|
-
var
|
|
2761
|
-
var
|
|
2859
|
+
var import_i18n41 = require("@wordpress/i18n");
|
|
2860
|
+
var audit19 = {
|
|
2762
2861
|
id: "audits/scan-for-cookies",
|
|
2763
|
-
title: (0,
|
|
2764
|
-
description: (0,
|
|
2862
|
+
title: (0, import_i18n41.__)("Scan for cookies", "elementor"),
|
|
2863
|
+
description: (0, import_i18n41.__)(
|
|
2765
2864
|
"Your site may be setting cookies you haven't disclosed. Some countries require a banner even without a full consent policy. Scan to see what needs disclosure.",
|
|
2766
2865
|
"elementor"
|
|
2767
2866
|
),
|
|
2768
|
-
fixHint: (0,
|
|
2867
|
+
fixHint: (0, import_i18n41.__)("Run a Cookiez scan on this page to see which cookies need disclosure.", "elementor"),
|
|
2769
2868
|
categories: ["compliance"],
|
|
2770
2869
|
severity: "info",
|
|
2771
2870
|
weight: 0,
|
|
@@ -2775,8 +2874,8 @@ var audit18 = {
|
|
|
2775
2874
|
status: "fail",
|
|
2776
2875
|
violations: [
|
|
2777
2876
|
{
|
|
2778
|
-
auditId:
|
|
2779
|
-
label: (0,
|
|
2877
|
+
auditId: audit19.id,
|
|
2878
|
+
label: (0, import_i18n41.__)("This page has not been scanned for cookies yet.", "elementor"),
|
|
2780
2879
|
externalUrl: isReady ? ctx.pageContext.cookiez_scan_url : ctx.pageContext.cookiez_plugin_action_url
|
|
2781
2880
|
}
|
|
2782
2881
|
]
|
|
@@ -2785,29 +2884,29 @@ var audit18 = {
|
|
|
2785
2884
|
};
|
|
2786
2885
|
|
|
2787
2886
|
// src/audits/sections-and-columns.ts
|
|
2788
|
-
var
|
|
2789
|
-
var
|
|
2887
|
+
var import_i18n42 = require("@wordpress/i18n");
|
|
2888
|
+
var audit20 = {
|
|
2790
2889
|
id: "audits/sections-and-columns",
|
|
2791
|
-
title: (0,
|
|
2792
|
-
description: (0,
|
|
2890
|
+
title: (0, import_i18n42.__)("Sections and columns", "elementor"),
|
|
2891
|
+
description: (0, import_i18n42.__)(
|
|
2793
2892
|
"Sections and columns are legacy elements. Containers render fewer DOM nodes and are more flexible.",
|
|
2794
2893
|
"elementor"
|
|
2795
2894
|
),
|
|
2796
|
-
fixHint: (0,
|
|
2895
|
+
fixHint: (0, import_i18n42.__)("Use the Container Converter to replace each section/column with a container.", "elementor"),
|
|
2797
2896
|
categories: ["best-practices", "performance"],
|
|
2798
2897
|
severity: "warning",
|
|
2799
2898
|
weight: 7,
|
|
2800
2899
|
evaluate: (ctx) => {
|
|
2801
2900
|
if (ctx.elements.tree.length === 0) {
|
|
2802
|
-
return { status: "skipped", reason: (0,
|
|
2901
|
+
return { status: "skipped", reason: (0, import_i18n42.__)("No elements", "elementor") };
|
|
2803
2902
|
}
|
|
2804
2903
|
const violations = [];
|
|
2805
2904
|
walkElements(ctx.elements.tree, (node) => {
|
|
2806
2905
|
if (node.elType === "section" || node.elType === "column") {
|
|
2807
2906
|
violations.push({
|
|
2808
|
-
auditId:
|
|
2907
|
+
auditId: audit20.id,
|
|
2809
2908
|
elementId: node.id,
|
|
2810
|
-
label: node.elType === "section" ? (0,
|
|
2909
|
+
label: node.elType === "section" ? (0, import_i18n42.__)("Section element", "elementor") : (0, import_i18n42.__)("Column element", "elementor")
|
|
2811
2910
|
});
|
|
2812
2911
|
}
|
|
2813
2912
|
});
|
|
@@ -2816,15 +2915,15 @@ var audit19 = {
|
|
|
2816
2915
|
};
|
|
2817
2916
|
|
|
2818
2917
|
// src/audits/site-identity.ts
|
|
2819
|
-
var
|
|
2820
|
-
var
|
|
2918
|
+
var import_i18n43 = require("@wordpress/i18n");
|
|
2919
|
+
var audit21 = {
|
|
2821
2920
|
id: "audits/site-identity",
|
|
2822
|
-
title: (0,
|
|
2823
|
-
description: (0,
|
|
2921
|
+
title: (0, import_i18n43.__)("Site identity", "elementor"),
|
|
2922
|
+
description: (0, import_i18n43.__)(
|
|
2824
2923
|
"Site name, description, logo, and favicon establish your brand and appear in search results and browser tabs.",
|
|
2825
2924
|
"elementor"
|
|
2826
2925
|
),
|
|
2827
|
-
fixHint: (0,
|
|
2926
|
+
fixHint: (0, import_i18n43.__)("Open Site Settings \u2192 Site Identity and complete all the missing fields.", "elementor"),
|
|
2828
2927
|
categories: ["best-practices", "seo"],
|
|
2829
2928
|
severity: "info",
|
|
2830
2929
|
weight: 7,
|
|
@@ -2833,30 +2932,30 @@ var audit20 = {
|
|
|
2833
2932
|
const violations = [];
|
|
2834
2933
|
if (!identity.site_name_set) {
|
|
2835
2934
|
violations.push({
|
|
2836
|
-
auditId:
|
|
2837
|
-
label: (0,
|
|
2935
|
+
auditId: audit21.id,
|
|
2936
|
+
label: (0, import_i18n43.__)("Site name is missing or still uses the default.", "elementor"),
|
|
2838
2937
|
targetHint: "site-identity-settings"
|
|
2839
2938
|
});
|
|
2840
2939
|
}
|
|
2841
2940
|
if (!identity.site_description_set) {
|
|
2842
2941
|
violations.push({
|
|
2843
|
-
auditId:
|
|
2844
|
-
label: (0,
|
|
2942
|
+
auditId: audit21.id,
|
|
2943
|
+
label: (0, import_i18n43.__)("Site description is missing or still uses the default.", "elementor"),
|
|
2845
2944
|
targetHint: "site-identity-settings",
|
|
2846
2945
|
angieFix: true
|
|
2847
2946
|
});
|
|
2848
2947
|
}
|
|
2849
2948
|
if (!identity.site_logo_set) {
|
|
2850
2949
|
violations.push({
|
|
2851
|
-
auditId:
|
|
2852
|
-
label: (0,
|
|
2950
|
+
auditId: audit21.id,
|
|
2951
|
+
label: (0, import_i18n43.__)("Site logo is not set.", "elementor"),
|
|
2853
2952
|
targetHint: "site-identity-settings"
|
|
2854
2953
|
});
|
|
2855
2954
|
}
|
|
2856
2955
|
if (!identity.site_favicon_set) {
|
|
2857
2956
|
violations.push({
|
|
2858
|
-
auditId:
|
|
2859
|
-
label: (0,
|
|
2957
|
+
auditId: audit21.id,
|
|
2958
|
+
label: (0, import_i18n43.__)("Site favicon is not set.", "elementor"),
|
|
2860
2959
|
targetHint: "site-identity-settings"
|
|
2861
2960
|
});
|
|
2862
2961
|
}
|
|
@@ -2871,19 +2970,19 @@ var audit20 = {
|
|
|
2871
2970
|
};
|
|
2872
2971
|
|
|
2873
2972
|
// src/audits/too-many-widgets.ts
|
|
2874
|
-
var
|
|
2973
|
+
var import_i18n44 = require("@wordpress/i18n");
|
|
2875
2974
|
var WIDGET_COUNT_THRESHOLD = 100;
|
|
2876
|
-
var
|
|
2975
|
+
var audit22 = {
|
|
2877
2976
|
id: "audits/too-many-widgets",
|
|
2878
|
-
title: (0,
|
|
2879
|
-
description: (0,
|
|
2880
|
-
fixHint: (0,
|
|
2977
|
+
title: (0, import_i18n44.__)("Too many widgets", "elementor"),
|
|
2978
|
+
description: (0, import_i18n44.__)("Excessive DOM size caused by too many widgets degrades rendering performance.", "elementor"),
|
|
2979
|
+
fixHint: (0, import_i18n44.__)("Reduce the number of widgets on the page by removing or combining elements.", "elementor"),
|
|
2881
2980
|
categories: ["best-practices", "performance"],
|
|
2882
2981
|
severity: "warning",
|
|
2883
2982
|
weight: 5,
|
|
2884
2983
|
evaluate: (ctx) => {
|
|
2885
2984
|
if (ctx.elements.tree.length === 0) {
|
|
2886
|
-
return { status: "skipped", reason: (0,
|
|
2985
|
+
return { status: "skipped", reason: (0, import_i18n44.__)("No elements", "elementor") };
|
|
2887
2986
|
}
|
|
2888
2987
|
let widgetCount = 0;
|
|
2889
2988
|
walkElements(ctx.elements.tree, (node) => {
|
|
@@ -2898,8 +2997,8 @@ var audit21 = {
|
|
|
2898
2997
|
status: "fail",
|
|
2899
2998
|
violations: [
|
|
2900
2999
|
{
|
|
2901
|
-
auditId:
|
|
2902
|
-
label: (0,
|
|
3000
|
+
auditId: audit22.id,
|
|
3001
|
+
label: (0, import_i18n44.__)("Page has too many widgets.", "elementor")
|
|
2903
3002
|
}
|
|
2904
3003
|
]
|
|
2905
3004
|
};
|
|
@@ -2908,31 +3007,32 @@ var audit21 = {
|
|
|
2908
3007
|
|
|
2909
3008
|
// src/register-audits.ts
|
|
2910
3009
|
var AUDITS = [
|
|
2911
|
-
|
|
2912
|
-
audit11,
|
|
3010
|
+
audit14,
|
|
2913
3011
|
audit12,
|
|
2914
|
-
|
|
3012
|
+
audit13,
|
|
3013
|
+
audit8,
|
|
2915
3014
|
audit5,
|
|
2916
|
-
|
|
2917
|
-
|
|
3015
|
+
audit22,
|
|
3016
|
+
audit20,
|
|
2918
3017
|
audit3,
|
|
2919
|
-
|
|
3018
|
+
audit11,
|
|
2920
3019
|
audit4,
|
|
2921
|
-
|
|
2922
|
-
audit14,
|
|
3020
|
+
audit21,
|
|
2923
3021
|
audit15,
|
|
2924
|
-
|
|
2925
|
-
|
|
3022
|
+
audit16,
|
|
3023
|
+
audit7,
|
|
2926
3024
|
audit9,
|
|
3025
|
+
audit10,
|
|
3026
|
+
audit18,
|
|
2927
3027
|
audit17,
|
|
2928
|
-
audit16,
|
|
2929
3028
|
audit,
|
|
2930
3029
|
audit2,
|
|
2931
|
-
|
|
3030
|
+
audit19,
|
|
3031
|
+
audit6
|
|
2932
3032
|
];
|
|
2933
3033
|
function registerAllAudits() {
|
|
2934
|
-
for (const
|
|
2935
|
-
registerAudit(
|
|
3034
|
+
for (const audit23 of AUDITS) {
|
|
3035
|
+
registerAudit(audit23);
|
|
2936
3036
|
}
|
|
2937
3037
|
}
|
|
2938
3038
|
|