@elementor/editor-audits 4.4.0-1106 → 4.4.0-1108
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 +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +343 -255
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +340 -252
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/audits/accessibility-statement.ts +39 -0
- package/src/audits/accessibility-widget.ts +41 -0
- package/src/audits/google-consent-mode.ts +4 -7
- package/src/components/violation-cta-button.tsx +3 -2
- package/src/components/violation-row.tsx +13 -4
- package/src/register-audits.ts +4 -0
- package/src/runner.ts +6 -2
- package/src/types.ts +6 -0
- package/src/utils/scan-accessibility-widgets.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -141,8 +141,8 @@ async function requestPageContext(documentId, imageSizeRequests, allowNonceRetry
|
|
|
141
141
|
|
|
142
142
|
// src/registry.ts
|
|
143
143
|
var registry = /* @__PURE__ */ new Map();
|
|
144
|
-
function registerAudit(
|
|
145
|
-
registry.set(
|
|
144
|
+
function registerAudit(audit25) {
|
|
145
|
+
registry.set(audit25.id, audit25);
|
|
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(audit25) {
|
|
183
|
+
return audit25.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: audit25, result } of report.auditResults) {
|
|
240
|
+
if (!isScoredAudit(audit25)) {
|
|
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: audit25, result } of results) {
|
|
291
291
|
if (result.status === "skipped") {
|
|
292
292
|
continue;
|
|
293
293
|
}
|
|
294
|
-
for (const category of
|
|
294
|
+
for (const category of audit25.categories) {
|
|
295
295
|
const acc = accumulators[category];
|
|
296
296
|
acc.total++;
|
|
297
|
-
acc.totalWeight +=
|
|
297
|
+
acc.totalWeight += audit25.weight;
|
|
298
298
|
if (result.status === "pass") {
|
|
299
|
-
acc.passedWeight +=
|
|
299
|
+
acc.passedWeight += audit25.weight;
|
|
300
300
|
} else {
|
|
301
301
|
acc.failed++;
|
|
302
302
|
}
|
|
@@ -320,6 +320,27 @@ function computeReport(documentId, results) {
|
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
+
// src/utils/fetch-rendered-html.ts
|
|
324
|
+
var FETCH_TIMEOUT_MS = 1e4;
|
|
325
|
+
async function fetchRenderedHtml(url) {
|
|
326
|
+
if (!url) {
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
const timeoutController = new AbortController();
|
|
330
|
+
const timeoutId = setTimeout(() => timeoutController.abort(), FETCH_TIMEOUT_MS);
|
|
331
|
+
try {
|
|
332
|
+
const response = await fetch(url, { credentials: "omit", signal: timeoutController.signal });
|
|
333
|
+
if (!response.ok) {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
return await response.text();
|
|
337
|
+
} catch {
|
|
338
|
+
return null;
|
|
339
|
+
} finally {
|
|
340
|
+
clearTimeout(timeoutId);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
323
344
|
// src/utils/atomic-background-image-sources.ts
|
|
324
345
|
var import_editor_elements = require("@elementor/editor-elements");
|
|
325
346
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
@@ -581,14 +602,17 @@ async function runPageAudit(documentId) {
|
|
|
581
602
|
const imageSizeRequests = extractImageSizeRequests(tree);
|
|
582
603
|
const pageContext = await fetchPageContext(documentId, imageSizeRequests);
|
|
583
604
|
const elements = { documentId, tree };
|
|
584
|
-
const kit = await
|
|
585
|
-
|
|
605
|
+
const [kit, renderedHtml] = await Promise.all([
|
|
606
|
+
readKitSnapshot(pageContext.kit_id),
|
|
607
|
+
fetchRenderedHtml(pageContext.frontend_url)
|
|
608
|
+
]);
|
|
609
|
+
const ctx = { documentId, elements, pageContext, kit, renderedHtml };
|
|
586
610
|
const registered = getRegisteredAudits();
|
|
587
611
|
const auditResults = await Promise.all(
|
|
588
|
-
registered.map(async (
|
|
589
|
-
const { evaluate: _evaluate, ...meta } =
|
|
612
|
+
registered.map(async (audit25) => {
|
|
613
|
+
const { evaluate: _evaluate, ...meta } = audit25;
|
|
590
614
|
try {
|
|
591
|
-
const result = await
|
|
615
|
+
const result = await audit25.evaluate(ctx);
|
|
592
616
|
return { audit: meta, result };
|
|
593
617
|
} catch (error) {
|
|
594
618
|
const reason = error instanceof Error ? error.message : "unknown-error";
|
|
@@ -1038,13 +1062,13 @@ function SeverityIcon({ severity }) {
|
|
|
1038
1062
|
// src/components/violation-cta-button.tsx
|
|
1039
1063
|
var React9 = __toESM(require("react"));
|
|
1040
1064
|
var import_ui8 = require("@elementor/ui");
|
|
1041
|
-
function ViolationCtaButton({ ctaLabel, externalUrl }) {
|
|
1065
|
+
function ViolationCtaButton({ ctaLabel, externalUrl, variant = "outlined" }) {
|
|
1042
1066
|
const handleClick = (event) => {
|
|
1043
1067
|
event.stopPropagation();
|
|
1044
1068
|
event.preventDefault();
|
|
1045
1069
|
window.open(externalUrl, "_blank", "noopener");
|
|
1046
1070
|
};
|
|
1047
|
-
return /* @__PURE__ */ React9.createElement(import_ui8.Button, { variant
|
|
1071
|
+
return /* @__PURE__ */ React9.createElement(import_ui8.Button, { variant, color: "secondary", size: "small", onClick: handleClick }, ctaLabel);
|
|
1048
1072
|
}
|
|
1049
1073
|
|
|
1050
1074
|
// src/components/violation-icons.tsx
|
|
@@ -1076,13 +1100,13 @@ function ViolationIcon({ violation, widgetIcon }) {
|
|
|
1076
1100
|
function SkipReasonTooltip({ reason }) {
|
|
1077
1101
|
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" })));
|
|
1078
1102
|
}
|
|
1079
|
-
function StatusIndicator({ audit:
|
|
1103
|
+
function StatusIndicator({ audit: audit25, violations }) {
|
|
1080
1104
|
if (violations) {
|
|
1081
|
-
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, isScoredAudit(
|
|
1105
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, isScoredAudit(audit25) && /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", color: "text.secondary", fontWeight: "bold" }, violations.length), /* @__PURE__ */ React11.createElement(SeverityIcon, { severity: audit25.severity }));
|
|
1082
1106
|
}
|
|
1083
1107
|
return /* @__PURE__ */ React11.createElement(import_icons7.CheckIcon, { fontSize: "small", color: "success" });
|
|
1084
1108
|
}
|
|
1085
|
-
function ViolationRow({ audit:
|
|
1109
|
+
function ViolationRow({ audit: audit25, skipReason, violations }) {
|
|
1086
1110
|
const [expanded, setExpanded] = (0, import_react4.useState)(false);
|
|
1087
1111
|
const toggleExpanded = () => setExpanded((value) => !value);
|
|
1088
1112
|
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(
|
|
@@ -1098,8 +1122,8 @@ function ViolationRow({ audit: audit23, skipReason, violations }) {
|
|
|
1098
1122
|
},
|
|
1099
1123
|
onClick: toggleExpanded
|
|
1100
1124
|
},
|
|
1101
|
-
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "body2", sx: { flex: 1 } },
|
|
1102
|
-
!skipReason && /* @__PURE__ */ React11.createElement(StatusIndicator, { audit:
|
|
1125
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "body2", sx: { flex: 1 } }, audit25.title),
|
|
1126
|
+
!skipReason && /* @__PURE__ */ React11.createElement(StatusIndicator, { audit: audit25, violations })
|
|
1103
1127
|
), skipReason && /* @__PURE__ */ React11.createElement(SkipReasonTooltip, { reason: skipReason }), /* @__PURE__ */ React11.createElement(
|
|
1104
1128
|
import_ui10.IconButton,
|
|
1105
1129
|
{
|
|
@@ -1125,7 +1149,7 @@ function ViolationRow({ audit: audit23, skipReason, violations }) {
|
|
|
1125
1149
|
icon: /* @__PURE__ */ React11.createElement(import_icons7.AlertCircleIcon, { fontSize: "small", color: "secondary", "aria-hidden": true })
|
|
1126
1150
|
},
|
|
1127
1151
|
/* @__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"))),
|
|
1128
|
-
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.secondary" },
|
|
1152
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.secondary" }, audit25.description)
|
|
1129
1153
|
), /* @__PURE__ */ React11.createElement(
|
|
1130
1154
|
import_ui10.Alert,
|
|
1131
1155
|
{
|
|
@@ -1134,7 +1158,7 @@ function ViolationRow({ audit: audit23, skipReason, violations }) {
|
|
|
1134
1158
|
icon: /* @__PURE__ */ React11.createElement(import_icons7.BulbIcon, { fontSize: "small", color: "info", "aria-hidden": true })
|
|
1135
1159
|
},
|
|
1136
1160
|
/* @__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"))),
|
|
1137
|
-
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.secondary" },
|
|
1161
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.secondary" }, audit25.fixHint)
|
|
1138
1162
|
)), violations && violations.length > 0 && /* @__PURE__ */ React11.createElement(import_ui10.Box, { role: "list", sx: { paddingBlockEnd: 1, paddingInlineStart: 2 } }, violations.map((violation, idx) => {
|
|
1139
1163
|
const widgetIcon = violation.elementId ? (0, import_editor_elements5.getElementIcon)(violation.elementId) : null;
|
|
1140
1164
|
const elementTitle = violation.elementId ? (0, import_editor_elements5.getElementTitle)(violation.elementId) : null;
|
|
@@ -1170,13 +1194,20 @@ function ViolationRow({ audit: audit23, skipReason, violations }) {
|
|
|
1170
1194
|
prompt: violation.angiePrompt ?? buildAngiePrompt(rowLabel)
|
|
1171
1195
|
}
|
|
1172
1196
|
),
|
|
1173
|
-
violation.ctaLabel && violation.externalUrl ? /* @__PURE__ */ React11.createElement(
|
|
1197
|
+
violation.ctaLabel && violation.externalUrl ? /* @__PURE__ */ React11.createElement(import_ui10.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, /* @__PURE__ */ React11.createElement(
|
|
1174
1198
|
ViolationCtaButton,
|
|
1175
1199
|
{
|
|
1176
1200
|
ctaLabel: violation.ctaLabel,
|
|
1177
1201
|
externalUrl: violation.externalUrl
|
|
1178
1202
|
}
|
|
1179
|
-
)
|
|
1203
|
+
), violation.secondaryCtaLabel && violation.secondaryCtaUrl && /* @__PURE__ */ React11.createElement(
|
|
1204
|
+
ViolationCtaButton,
|
|
1205
|
+
{
|
|
1206
|
+
ctaLabel: violation.secondaryCtaLabel,
|
|
1207
|
+
externalUrl: violation.secondaryCtaUrl,
|
|
1208
|
+
variant: "text"
|
|
1209
|
+
}
|
|
1210
|
+
)) : /* @__PURE__ */ React11.createElement(
|
|
1180
1211
|
import_icons7.EyeIcon,
|
|
1181
1212
|
{
|
|
1182
1213
|
className: "violation-hover-icon",
|
|
@@ -1274,17 +1305,17 @@ var import_i18n14 = require("@wordpress/i18n");
|
|
|
1274
1305
|
var ALL_SEVERITIES = ["error", "warning", "info"];
|
|
1275
1306
|
function countSeverities(report, category) {
|
|
1276
1307
|
const counts = { error: 0, warning: 0, info: 0 };
|
|
1277
|
-
for (const { audit:
|
|
1308
|
+
for (const { audit: audit25, result } of report.auditResults) {
|
|
1278
1309
|
if (result.status !== "fail") {
|
|
1279
1310
|
continue;
|
|
1280
1311
|
}
|
|
1281
|
-
if (category && !
|
|
1312
|
+
if (category && !audit25.categories.includes(category)) {
|
|
1282
1313
|
continue;
|
|
1283
1314
|
}
|
|
1284
|
-
if (!isScoredAudit(
|
|
1315
|
+
if (!isScoredAudit(audit25)) {
|
|
1285
1316
|
continue;
|
|
1286
1317
|
}
|
|
1287
|
-
counts[
|
|
1318
|
+
counts[audit25.severity] += result.violations.length;
|
|
1288
1319
|
}
|
|
1289
1320
|
return counts;
|
|
1290
1321
|
}
|
|
@@ -1968,16 +1999,93 @@ var audit = {
|
|
|
1968
1999
|
}
|
|
1969
2000
|
};
|
|
1970
2001
|
|
|
1971
|
-
// src/audits/
|
|
2002
|
+
// src/audits/accessibility-statement.ts
|
|
1972
2003
|
var import_i18n26 = require("@wordpress/i18n");
|
|
1973
2004
|
var audit2 = {
|
|
1974
|
-
id: "audits/
|
|
1975
|
-
title: (0, import_i18n26.__)("
|
|
2005
|
+
id: "audits/accessibility-statement",
|
|
2006
|
+
title: (0, import_i18n26.__)("Create an accessibility statement", "elementor"),
|
|
1976
2007
|
description: (0, import_i18n26.__)(
|
|
2008
|
+
"An accessibility statement showcases your efforts to create an inclusive online space, highlighting helpful features and a commitment to accessibility.",
|
|
2009
|
+
"elementor"
|
|
2010
|
+
),
|
|
2011
|
+
fixHint: (0, import_i18n26.__)("Use Ally to create and publish an accessibility statement for your site.", "elementor"),
|
|
2012
|
+
categories: ["accessibility"],
|
|
2013
|
+
severity: "info",
|
|
2014
|
+
weight: 1,
|
|
2015
|
+
evaluate: (ctx) => {
|
|
2016
|
+
const isReady = ctx.pageContext.ally_plugin_active;
|
|
2017
|
+
if (isReady && ctx.pageContext.ally_accessibility_statement_created) {
|
|
2018
|
+
return { status: "pass" };
|
|
2019
|
+
}
|
|
2020
|
+
return {
|
|
2021
|
+
status: "fail",
|
|
2022
|
+
violations: [
|
|
2023
|
+
{
|
|
2024
|
+
auditId: audit2.id,
|
|
2025
|
+
label: (0, import_i18n26.__)("No accessibility statement has been created for this site.", "elementor"),
|
|
2026
|
+
externalUrl: isReady ? ctx.pageContext.ally_accessibility_statement_url : ctx.pageContext.ally_plugin_url,
|
|
2027
|
+
ctaLabel: isReady ? (0, import_i18n26.__)("Create", "elementor") : void 0,
|
|
2028
|
+
secondaryCtaLabel: (0, import_i18n26.__)("Learn more", "elementor"),
|
|
2029
|
+
secondaryCtaUrl: "https://go.elementor.com/acc-plg-learn-more"
|
|
2030
|
+
}
|
|
2031
|
+
]
|
|
2032
|
+
};
|
|
2033
|
+
}
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
// src/audits/accessibility-widget.ts
|
|
2037
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
2038
|
+
|
|
2039
|
+
// src/utils/scan-accessibility-widgets.ts
|
|
2040
|
+
var ACCESSIBILITY_WIDGET_SCRIPT_SOURCES = ["cdn.elementor.com/a11y/widget.js"];
|
|
2041
|
+
function hasAccessibilityWidgetScript(html) {
|
|
2042
|
+
return ACCESSIBILITY_WIDGET_SCRIPT_SOURCES.some((src) => html.includes(src));
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
// src/audits/accessibility-widget.ts
|
|
2046
|
+
var audit3 = {
|
|
2047
|
+
id: "audits/accessibility-widget",
|
|
2048
|
+
title: (0, import_i18n27.__)("Add an accessibility widget", "elementor"),
|
|
2049
|
+
description: (0, import_i18n27.__)("Make your site more inclusive by adding an accessibility widget.", "elementor"),
|
|
2050
|
+
fixHint: (0, import_i18n27.__)("Activate Ally\u2019s accessibility widget to give visitors on-page accessibility tools.", "elementor"),
|
|
2051
|
+
categories: ["accessibility"],
|
|
2052
|
+
severity: "info",
|
|
2053
|
+
weight: 1,
|
|
2054
|
+
evaluate: (ctx) => {
|
|
2055
|
+
if (!ctx.pageContext.frontend_url) {
|
|
2056
|
+
return { status: "skipped", reason: (0, import_i18n27.__)("Page is not published.", "elementor") };
|
|
2057
|
+
}
|
|
2058
|
+
if (!ctx.renderedHtml) {
|
|
2059
|
+
return { status: "skipped", reason: (0, import_i18n27.__)("Could not fetch the published page.", "elementor") };
|
|
2060
|
+
}
|
|
2061
|
+
if (hasAccessibilityWidgetScript(ctx.renderedHtml)) {
|
|
2062
|
+
return { status: "pass" };
|
|
2063
|
+
}
|
|
2064
|
+
const isReady = ctx.pageContext.ally_plugin_active;
|
|
2065
|
+
return {
|
|
2066
|
+
status: "fail",
|
|
2067
|
+
violations: [
|
|
2068
|
+
{
|
|
2069
|
+
auditId: audit3.id,
|
|
2070
|
+
label: (0, import_i18n27.__)("No accessibility widget is active on this site.", "elementor"),
|
|
2071
|
+
externalUrl: isReady ? ctx.pageContext.ally_widget_settings_url : ctx.pageContext.ally_plugin_url,
|
|
2072
|
+
ctaLabel: (0, import_i18n27.__)("Activate", "elementor")
|
|
2073
|
+
}
|
|
2074
|
+
]
|
|
2075
|
+
};
|
|
2076
|
+
}
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
// src/audits/cookie-policy.ts
|
|
2080
|
+
var import_i18n28 = require("@wordpress/i18n");
|
|
2081
|
+
var audit4 = {
|
|
2082
|
+
id: "audits/cookie-policy",
|
|
2083
|
+
title: (0, import_i18n28.__)("Cookie policy", "elementor"),
|
|
2084
|
+
description: (0, import_i18n28.__)(
|
|
1977
2085
|
"A cookie policy is required by privacy regulations such as GDPR (EU) or CCPA (US) to inform visitors about tracking and data collection.",
|
|
1978
2086
|
"elementor"
|
|
1979
2087
|
),
|
|
1980
|
-
fixHint: (0,
|
|
2088
|
+
fixHint: (0, import_i18n28.__)("Install the Cookiez plugin to add a cookie policy to your website.", "elementor"),
|
|
1981
2089
|
categories: ["compliance"],
|
|
1982
2090
|
severity: "info",
|
|
1983
2091
|
weight: 1,
|
|
@@ -1989,8 +2097,8 @@ var audit2 = {
|
|
|
1989
2097
|
status: "fail",
|
|
1990
2098
|
violations: [
|
|
1991
2099
|
{
|
|
1992
|
-
auditId:
|
|
1993
|
-
label: (0,
|
|
2100
|
+
auditId: audit4.id,
|
|
2101
|
+
label: (0, import_i18n28.__)("Cookiez plugin is not installed or active.", "elementor"),
|
|
1994
2102
|
externalUrl: ctx.pageContext.cookiez_plugin_url
|
|
1995
2103
|
}
|
|
1996
2104
|
]
|
|
@@ -2000,7 +2108,7 @@ var audit2 = {
|
|
|
2000
2108
|
|
|
2001
2109
|
// src/audits/deep-nesting.ts
|
|
2002
2110
|
var import_editor_elements7 = require("@elementor/editor-elements");
|
|
2003
|
-
var
|
|
2111
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
2004
2112
|
var MAX_NESTING_DEPTH = 6;
|
|
2005
2113
|
function isNestingElement(node, widgetsCache) {
|
|
2006
2114
|
if (node.elType === "container") {
|
|
@@ -2008,20 +2116,20 @@ function isNestingElement(node, widgetsCache) {
|
|
|
2008
2116
|
}
|
|
2009
2117
|
return !!widgetsCache?.[node.elType]?.meta?.is_container;
|
|
2010
2118
|
}
|
|
2011
|
-
var
|
|
2119
|
+
var audit5 = {
|
|
2012
2120
|
id: "audits/deep-nesting",
|
|
2013
|
-
title: (0,
|
|
2014
|
-
description: (0,
|
|
2121
|
+
title: (0, import_i18n29.__)("Deep container nesting", "elementor"),
|
|
2122
|
+
description: (0, import_i18n29.__)(
|
|
2015
2123
|
"Container nesting exceeds the recommended depth. Deep DOM trees hurt rendering performance and readability.",
|
|
2016
2124
|
"elementor"
|
|
2017
2125
|
),
|
|
2018
|
-
fixHint: (0,
|
|
2126
|
+
fixHint: (0, import_i18n29.__)("Flatten the layout by removing unnecessary wrapper containers.", "elementor"),
|
|
2019
2127
|
categories: ["performance", "best-practices"],
|
|
2020
2128
|
severity: "warning",
|
|
2021
2129
|
weight: 5,
|
|
2022
2130
|
evaluate: (ctx) => {
|
|
2023
2131
|
if (ctx.elements.tree.length === 0) {
|
|
2024
|
-
return { status: "skipped", reason: (0,
|
|
2132
|
+
return { status: "skipped", reason: (0, import_i18n29.__)("No elements", "elementor") };
|
|
2025
2133
|
}
|
|
2026
2134
|
const widgetsCache = (0, import_editor_elements7.getWidgetsCache)();
|
|
2027
2135
|
const violations = [];
|
|
@@ -2032,10 +2140,10 @@ var audit3 = {
|
|
|
2032
2140
|
const depth = parents.filter((parent) => isNestingElement(parent, widgetsCache)).length + 1;
|
|
2033
2141
|
if (depth > MAX_NESTING_DEPTH) {
|
|
2034
2142
|
violations.push({
|
|
2035
|
-
auditId:
|
|
2143
|
+
auditId: audit5.id,
|
|
2036
2144
|
elementId: node.id,
|
|
2037
2145
|
targetHint: "element-settings",
|
|
2038
|
-
label: (0,
|
|
2146
|
+
label: (0, import_i18n29.__)("Container nesting is too deep.", "elementor")
|
|
2039
2147
|
});
|
|
2040
2148
|
}
|
|
2041
2149
|
});
|
|
@@ -2044,15 +2152,15 @@ var audit3 = {
|
|
|
2044
2152
|
};
|
|
2045
2153
|
|
|
2046
2154
|
// src/audits/default-design-system.ts
|
|
2047
|
-
var
|
|
2048
|
-
var
|
|
2155
|
+
var import_i18n30 = require("@wordpress/i18n");
|
|
2156
|
+
var audit6 = {
|
|
2049
2157
|
id: "audits/default-design-system",
|
|
2050
|
-
title: (0,
|
|
2051
|
-
description: (0,
|
|
2158
|
+
title: (0, import_i18n30.__)("Default website kit", "elementor"),
|
|
2159
|
+
description: (0, import_i18n30.__)(
|
|
2052
2160
|
"Your website is using the default design system colors and fonts. Custom branding makes the website feel uniquely yours.",
|
|
2053
2161
|
"elementor"
|
|
2054
2162
|
),
|
|
2055
|
-
fixHint: (0,
|
|
2163
|
+
fixHint: (0, import_i18n30.__)("Open Site Settings and customize your kit (colors, fonts, layout).", "elementor"),
|
|
2056
2164
|
categories: ["best-practices"],
|
|
2057
2165
|
severity: "info",
|
|
2058
2166
|
weight: 1,
|
|
@@ -2064,8 +2172,8 @@ var audit4 = {
|
|
|
2064
2172
|
status: "fail",
|
|
2065
2173
|
violations: [
|
|
2066
2174
|
{
|
|
2067
|
-
auditId:
|
|
2068
|
-
label: (0,
|
|
2175
|
+
auditId: audit6.id,
|
|
2176
|
+
label: (0, import_i18n30.__)("Kit appears unchanged from default.", "elementor"),
|
|
2069
2177
|
targetHint: "site-settings"
|
|
2070
2178
|
}
|
|
2071
2179
|
]
|
|
@@ -2075,16 +2183,16 @@ var audit4 = {
|
|
|
2075
2183
|
|
|
2076
2184
|
// src/audits/deprecated-widgets.ts
|
|
2077
2185
|
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
2078
|
-
var
|
|
2186
|
+
var import_i18n31 = require("@wordpress/i18n");
|
|
2079
2187
|
var DEPRECATION_CONTROL_NAME = "deprecation_message";
|
|
2080
|
-
var
|
|
2188
|
+
var audit7 = {
|
|
2081
2189
|
id: "audits/deprecated-widgets",
|
|
2082
|
-
title: (0,
|
|
2083
|
-
description: (0,
|
|
2190
|
+
title: (0, import_i18n31.__)("Deprecated widgets", "elementor"),
|
|
2191
|
+
description: (0, import_i18n31.__)(
|
|
2084
2192
|
"Deprecated widgets should not be used. For better capabilities use the recommended replacement.",
|
|
2085
2193
|
"elementor"
|
|
2086
2194
|
),
|
|
2087
|
-
fixHint: (0,
|
|
2195
|
+
fixHint: (0, import_i18n31.__)("Replace each deprecated widget with the recommended new widget shown in its panel.", "elementor"),
|
|
2088
2196
|
categories: ["best-practices", "performance"],
|
|
2089
2197
|
severity: "warning",
|
|
2090
2198
|
weight: 7,
|
|
@@ -2108,10 +2216,10 @@ var audit5 = {
|
|
|
2108
2216
|
return;
|
|
2109
2217
|
}
|
|
2110
2218
|
violations.push({
|
|
2111
|
-
auditId:
|
|
2219
|
+
auditId: audit7.id,
|
|
2112
2220
|
elementId: node.id,
|
|
2113
2221
|
targetHint: "element-settings",
|
|
2114
|
-
label: (0,
|
|
2222
|
+
label: (0, import_i18n31.__)("Using deprecated widget.", "elementor")
|
|
2115
2223
|
});
|
|
2116
2224
|
});
|
|
2117
2225
|
return violations.length === 0 ? { status: "pass" } : { status: "fail", violations };
|
|
@@ -2119,28 +2227,7 @@ var audit5 = {
|
|
|
2119
2227
|
};
|
|
2120
2228
|
|
|
2121
2229
|
// src/audits/google-consent-mode.ts
|
|
2122
|
-
var
|
|
2123
|
-
|
|
2124
|
-
// src/utils/fetch-rendered-html.ts
|
|
2125
|
-
var FETCH_TIMEOUT_MS = 1e4;
|
|
2126
|
-
async function fetchRenderedHtml(url) {
|
|
2127
|
-
if (!url) {
|
|
2128
|
-
return null;
|
|
2129
|
-
}
|
|
2130
|
-
const timeoutController = new AbortController();
|
|
2131
|
-
const timeoutId = setTimeout(() => timeoutController.abort(), FETCH_TIMEOUT_MS);
|
|
2132
|
-
try {
|
|
2133
|
-
const response = await fetch(url, { credentials: "omit", signal: timeoutController.signal });
|
|
2134
|
-
if (!response.ok) {
|
|
2135
|
-
return null;
|
|
2136
|
-
}
|
|
2137
|
-
return await response.text();
|
|
2138
|
-
} catch {
|
|
2139
|
-
return null;
|
|
2140
|
-
} finally {
|
|
2141
|
-
clearTimeout(timeoutId);
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2230
|
+
var import_i18n32 = require("@wordpress/i18n");
|
|
2144
2231
|
|
|
2145
2232
|
// src/utils/scan-consent-signals.ts
|
|
2146
2233
|
var GOOGLE_TRACKING_PATTERNS = [
|
|
@@ -2161,44 +2248,43 @@ function hasConsentDefaultCall(html) {
|
|
|
2161
2248
|
}
|
|
2162
2249
|
|
|
2163
2250
|
// src/audits/google-consent-mode.ts
|
|
2164
|
-
var
|
|
2251
|
+
var audit8 = {
|
|
2165
2252
|
id: "audits/google-consent-mode",
|
|
2166
|
-
title: (0,
|
|
2167
|
-
description: (0,
|
|
2253
|
+
title: (0, import_i18n32.__)("Google Consent Mode", "elementor"),
|
|
2254
|
+
description: (0, import_i18n32.__)(
|
|
2168
2255
|
"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.",
|
|
2169
2256
|
"elementor"
|
|
2170
2257
|
),
|
|
2171
|
-
fixHint: (0,
|
|
2258
|
+
fixHint: (0, import_i18n32.__)(
|
|
2172
2259
|
"Turn on Google Consent Mode in your cookie consent plugin so Google tags respect visitor consent choices.",
|
|
2173
2260
|
"elementor"
|
|
2174
2261
|
),
|
|
2175
2262
|
categories: ["compliance"],
|
|
2176
2263
|
severity: "warning",
|
|
2177
2264
|
weight: 1,
|
|
2178
|
-
evaluate:
|
|
2265
|
+
evaluate: (ctx) => {
|
|
2179
2266
|
if (!ctx.pageContext.frontend_url) {
|
|
2180
|
-
return { status: "skipped", reason: (0,
|
|
2267
|
+
return { status: "skipped", reason: (0, import_i18n32.__)("Page is not published.", "elementor") };
|
|
2181
2268
|
}
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
return { status: "skipped", reason: (0, import_i18n30.__)("Could not fetch the published page.", "elementor") };
|
|
2269
|
+
if (!ctx.renderedHtml) {
|
|
2270
|
+
return { status: "skipped", reason: (0, import_i18n32.__)("Could not fetch the published page.", "elementor") };
|
|
2185
2271
|
}
|
|
2186
|
-
if (!hasGoogleTracking(
|
|
2187
|
-
return { status: "skipped", reason: (0,
|
|
2272
|
+
if (!hasGoogleTracking(ctx.renderedHtml)) {
|
|
2273
|
+
return { status: "skipped", reason: (0, import_i18n32.__)("No Google tracking product detected.", "elementor") };
|
|
2188
2274
|
}
|
|
2189
|
-
if (hasConsentDefaultCall(
|
|
2275
|
+
if (hasConsentDefaultCall(ctx.renderedHtml)) {
|
|
2190
2276
|
return { status: "pass" };
|
|
2191
2277
|
}
|
|
2192
|
-
const label = (0,
|
|
2278
|
+
const label = (0, import_i18n32.__)("No Google Consent Mode signal was found on the page.", "elementor");
|
|
2193
2279
|
const isCookiezReady = ctx.pageContext.cookiez_plugin_installed && ctx.pageContext.cookiez_plugin_active;
|
|
2194
2280
|
if (isCookiezReady) {
|
|
2195
2281
|
return {
|
|
2196
2282
|
status: "fail",
|
|
2197
2283
|
violations: [
|
|
2198
2284
|
{
|
|
2199
|
-
auditId:
|
|
2285
|
+
auditId: audit8.id,
|
|
2200
2286
|
label,
|
|
2201
|
-
ctaLabel: (0,
|
|
2287
|
+
ctaLabel: (0, import_i18n32.__)("Enable", "elementor"),
|
|
2202
2288
|
externalUrl: ctx.pageContext.cookiez_consent_mode_settings_url
|
|
2203
2289
|
}
|
|
2204
2290
|
]
|
|
@@ -2208,7 +2294,7 @@ var audit6 = {
|
|
|
2208
2294
|
status: "fail",
|
|
2209
2295
|
violations: [
|
|
2210
2296
|
{
|
|
2211
|
-
auditId:
|
|
2297
|
+
auditId: audit8.id,
|
|
2212
2298
|
label,
|
|
2213
2299
|
externalUrl: ctx.pageContext.cookiez_plugin_action_url
|
|
2214
2300
|
}
|
|
@@ -2218,7 +2304,7 @@ var audit6 = {
|
|
|
2218
2304
|
};
|
|
2219
2305
|
|
|
2220
2306
|
// src/audits/heading-structure.ts
|
|
2221
|
-
var
|
|
2307
|
+
var import_i18n33 = require("@wordpress/i18n");
|
|
2222
2308
|
var HEADING_LEVELS = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
2223
2309
|
var HEADING_CONTROLS_REGISTRY = {
|
|
2224
2310
|
// Core
|
|
@@ -2394,47 +2480,47 @@ function extractPageHeadings(tree) {
|
|
|
2394
2480
|
});
|
|
2395
2481
|
return headings;
|
|
2396
2482
|
}
|
|
2397
|
-
var
|
|
2483
|
+
var audit9 = {
|
|
2398
2484
|
id: "audits/heading-structure",
|
|
2399
|
-
title: (0,
|
|
2400
|
-
description: (0,
|
|
2401
|
-
fixHint: (0,
|
|
2485
|
+
title: (0, import_i18n33.__)("Heading structure", "elementor"),
|
|
2486
|
+
description: (0, import_i18n33.__)("Pages should have exactly one H1 and a non-skipping heading order.", "elementor"),
|
|
2487
|
+
fixHint: (0, import_i18n33.__)("Ensure your page has one H1 and that heading levels do not skip (no H2 \u2192 H4).", "elementor"),
|
|
2402
2488
|
categories: ["seo", "accessibility"],
|
|
2403
2489
|
severity: "error",
|
|
2404
2490
|
weight: 10,
|
|
2405
2491
|
evaluate: (ctx) => {
|
|
2406
2492
|
if (ctx.elements.tree.length === 0) {
|
|
2407
|
-
return { status: "skipped", reason: (0,
|
|
2493
|
+
return { status: "skipped", reason: (0, import_i18n33.__)("No elements", "elementor") };
|
|
2408
2494
|
}
|
|
2409
2495
|
const headings = extractPageHeadings(ctx.elements.tree);
|
|
2410
2496
|
const violations = [];
|
|
2411
2497
|
if (headings.length === 0) {
|
|
2412
2498
|
violations.push({
|
|
2413
|
-
auditId:
|
|
2414
|
-
label: (0,
|
|
2499
|
+
auditId: audit9.id,
|
|
2500
|
+
label: (0, import_i18n33.__)("No headings found on the page.", "elementor")
|
|
2415
2501
|
});
|
|
2416
2502
|
} else {
|
|
2417
2503
|
const h1Count = headings.filter((h) => h.level === 1).length;
|
|
2418
2504
|
if (h1Count === 0) {
|
|
2419
|
-
violations.push({ auditId:
|
|
2505
|
+
violations.push({ auditId: audit9.id, label: (0, import_i18n33.__)("No H1 on the page.", "elementor") });
|
|
2420
2506
|
}
|
|
2421
2507
|
if (h1Count > 1) {
|
|
2422
2508
|
headings.filter((h) => h.level === 1).slice(1).forEach(
|
|
2423
2509
|
(h) => violations.push({
|
|
2424
|
-
auditId:
|
|
2510
|
+
auditId: audit9.id,
|
|
2425
2511
|
elementId: h.elementId,
|
|
2426
2512
|
targetHint: "element-settings",
|
|
2427
|
-
label: (0,
|
|
2513
|
+
label: (0, import_i18n33.__)("More than one H1 on the page.", "elementor")
|
|
2428
2514
|
})
|
|
2429
2515
|
);
|
|
2430
2516
|
}
|
|
2431
2517
|
for (let i = 1; i < headings.length; i++) {
|
|
2432
2518
|
if (headings[i].level - headings[i - 1].level > 1) {
|
|
2433
2519
|
violations.push({
|
|
2434
|
-
auditId:
|
|
2520
|
+
auditId: audit9.id,
|
|
2435
2521
|
elementId: headings[i].elementId,
|
|
2436
2522
|
targetHint: "element-settings",
|
|
2437
|
-
label: (0,
|
|
2523
|
+
label: (0, import_i18n33.__)("Heading level skipped.", "elementor")
|
|
2438
2524
|
});
|
|
2439
2525
|
}
|
|
2440
2526
|
}
|
|
@@ -2444,33 +2530,33 @@ var audit7 = {
|
|
|
2444
2530
|
};
|
|
2445
2531
|
|
|
2446
2532
|
// src/audits/hidden-elements.ts
|
|
2447
|
-
var
|
|
2533
|
+
var import_i18n34 = require("@wordpress/i18n");
|
|
2448
2534
|
function isHiddenOnAllDevices(settings) {
|
|
2449
2535
|
return Boolean(settings.hide_desktop) && Boolean(settings.hide_tablet) && Boolean(settings.hide_mobile);
|
|
2450
2536
|
}
|
|
2451
|
-
var
|
|
2537
|
+
var audit10 = {
|
|
2452
2538
|
id: "audits/hidden-elements",
|
|
2453
|
-
title: (0,
|
|
2454
|
-
description: (0,
|
|
2539
|
+
title: (0, import_i18n34.__)("Hidden elements", "elementor"),
|
|
2540
|
+
description: (0, import_i18n34.__)(
|
|
2455
2541
|
"Elements hidden on all devices simultaneously are effectively dead code in the page tree.",
|
|
2456
2542
|
"elementor"
|
|
2457
2543
|
),
|
|
2458
|
-
fixHint: (0,
|
|
2544
|
+
fixHint: (0, import_i18n34.__)("Remove the element or make it visible on at least one device breakpoint.", "elementor"),
|
|
2459
2545
|
categories: ["best-practices", "performance"],
|
|
2460
2546
|
severity: "info",
|
|
2461
2547
|
weight: 3,
|
|
2462
2548
|
evaluate: (ctx) => {
|
|
2463
2549
|
if (ctx.elements.tree.length === 0) {
|
|
2464
|
-
return { status: "skipped", reason: (0,
|
|
2550
|
+
return { status: "skipped", reason: (0, import_i18n34.__)("No elements", "elementor") };
|
|
2465
2551
|
}
|
|
2466
2552
|
const violations = [];
|
|
2467
2553
|
walkElements(ctx.elements.tree, (node) => {
|
|
2468
2554
|
if (isHiddenOnAllDevices(node.settings)) {
|
|
2469
2555
|
violations.push({
|
|
2470
|
-
auditId:
|
|
2556
|
+
auditId: audit10.id,
|
|
2471
2557
|
elementId: node.id,
|
|
2472
2558
|
targetHint: "element-settings",
|
|
2473
|
-
label: (0,
|
|
2559
|
+
label: (0, import_i18n34.__)("Element is hidden on all devices.", "elementor")
|
|
2474
2560
|
});
|
|
2475
2561
|
}
|
|
2476
2562
|
});
|
|
@@ -2479,7 +2565,7 @@ var audit8 = {
|
|
|
2479
2565
|
};
|
|
2480
2566
|
|
|
2481
2567
|
// src/audits/images-alt-text.ts
|
|
2482
|
-
var
|
|
2568
|
+
var import_i18n35 = require("@wordpress/i18n");
|
|
2483
2569
|
|
|
2484
2570
|
// src/utils/image-alt.ts
|
|
2485
2571
|
function hasMeaningfulAlt(media, pageContext) {
|
|
@@ -2498,17 +2584,17 @@ function isImageSourcePresent(media) {
|
|
|
2498
2584
|
}
|
|
2499
2585
|
|
|
2500
2586
|
// src/audits/images-alt-text.ts
|
|
2501
|
-
var
|
|
2587
|
+
var audit11 = {
|
|
2502
2588
|
id: "audits/images-alt-text",
|
|
2503
|
-
title: (0,
|
|
2504
|
-
description: (0,
|
|
2505
|
-
fixHint: (0,
|
|
2589
|
+
title: (0, import_i18n35.__)("Images alt text", "elementor"),
|
|
2590
|
+
description: (0, import_i18n35.__)("Every image needs a meaningful alt attribute for screen readers and image-search.", "elementor"),
|
|
2591
|
+
fixHint: (0, import_i18n35.__)("Open the image's settings and add an Alt Text describing the image.", "elementor"),
|
|
2506
2592
|
categories: ["seo", "accessibility"],
|
|
2507
2593
|
severity: "error",
|
|
2508
2594
|
weight: 10,
|
|
2509
2595
|
evaluate: (ctx) => {
|
|
2510
2596
|
if (!hasPageImages(ctx.elements.tree)) {
|
|
2511
|
-
return { status: "skipped", reason: (0,
|
|
2597
|
+
return { status: "skipped", reason: (0, import_i18n35.__)("No images", "elementor") };
|
|
2512
2598
|
}
|
|
2513
2599
|
const violations = [];
|
|
2514
2600
|
const failedWidgetIds = /* @__PURE__ */ new Set();
|
|
@@ -2521,10 +2607,10 @@ var audit9 = {
|
|
|
2521
2607
|
if (!failedWidgetIds.has(node.id)) {
|
|
2522
2608
|
failedWidgetIds.add(node.id);
|
|
2523
2609
|
violations.push({
|
|
2524
|
-
auditId:
|
|
2610
|
+
auditId: audit11.id,
|
|
2525
2611
|
elementId: node.id,
|
|
2526
2612
|
targetHint: "element-settings",
|
|
2527
|
-
label: (0,
|
|
2613
|
+
label: (0, import_i18n35.__)("Image is missing alt text.", "elementor"),
|
|
2528
2614
|
externalUrl: ctx.pageContext.ally_plugin_url
|
|
2529
2615
|
});
|
|
2530
2616
|
}
|
|
@@ -2534,14 +2620,14 @@ var audit9 = {
|
|
|
2534
2620
|
};
|
|
2535
2621
|
|
|
2536
2622
|
// src/audits/images-too-large.ts
|
|
2537
|
-
var
|
|
2623
|
+
var import_i18n36 = require("@wordpress/i18n");
|
|
2538
2624
|
var SIZE_THRESHOLD_BYTES = 500 * 1024;
|
|
2539
2625
|
var BYTES_PER_KB = 1024;
|
|
2540
|
-
var
|
|
2626
|
+
var audit12 = {
|
|
2541
2627
|
id: "audits/images-too-large",
|
|
2542
|
-
title: (0,
|
|
2543
|
-
description: (0,
|
|
2544
|
-
fixHint: (0,
|
|
2628
|
+
title: (0, import_i18n36.__)("Oversized images", "elementor"),
|
|
2629
|
+
description: (0, import_i18n36.__)("Large image files slow down the page.", "elementor"),
|
|
2630
|
+
fixHint: (0, import_i18n36.__)("Replace the image with a smaller version or enable image optimization.", "elementor"),
|
|
2545
2631
|
categories: ["performance"],
|
|
2546
2632
|
severity: "warning",
|
|
2547
2633
|
weight: 7,
|
|
@@ -2571,15 +2657,15 @@ var audit10 = {
|
|
|
2571
2657
|
walkAtomicImageSources(ctx.elements.tree, ({ node, media }) => evaluateSource(node, media));
|
|
2572
2658
|
walkAtomicBackgroundImageSources(ctx.elements.tree, ({ node, media }) => evaluateSource(node, media));
|
|
2573
2659
|
if (!hasAnyImage) {
|
|
2574
|
-
return { status: "skipped", reason: (0,
|
|
2660
|
+
return { status: "skipped", reason: (0, import_i18n36.__)("No images", "elementor") };
|
|
2575
2661
|
}
|
|
2576
2662
|
const violations = Array.from(widgetMaxKb.entries()).map(([elementId, kb]) => ({
|
|
2577
|
-
auditId:
|
|
2663
|
+
auditId: audit12.id,
|
|
2578
2664
|
elementId,
|
|
2579
2665
|
targetHint: "element-settings",
|
|
2580
|
-
label: (0,
|
|
2666
|
+
label: (0, import_i18n36.sprintf)(
|
|
2581
2667
|
/* translators: %d is the image file size in kilobytes. */
|
|
2582
|
-
(0,
|
|
2668
|
+
(0, import_i18n36.__)("Image is %d KB (over 500 KB).", "elementor"),
|
|
2583
2669
|
kb
|
|
2584
2670
|
),
|
|
2585
2671
|
externalUrl: ctx.pageContext.image_optimization_plugin_url
|
|
@@ -2589,21 +2675,21 @@ var audit10 = {
|
|
|
2589
2675
|
};
|
|
2590
2676
|
|
|
2591
2677
|
// src/audits/nested-boxed-containers.ts
|
|
2592
|
-
var
|
|
2678
|
+
var import_i18n37 = require("@wordpress/i18n");
|
|
2593
2679
|
function isBoxed(settings) {
|
|
2594
2680
|
return settings.content_width === "boxed";
|
|
2595
2681
|
}
|
|
2596
|
-
var
|
|
2682
|
+
var audit13 = {
|
|
2597
2683
|
id: "audits/nested-boxed-containers",
|
|
2598
|
-
title: (0,
|
|
2599
|
-
description: (0,
|
|
2600
|
-
fixHint: (0,
|
|
2684
|
+
title: (0, import_i18n37.__)("Boxed container nested inside a boxed parent", "elementor"),
|
|
2685
|
+
description: (0, import_i18n37.__)("An inner container does not need to be boxed when its parent already is.", "elementor"),
|
|
2686
|
+
fixHint: (0, import_i18n37.__)("Change the inner container's content width to Full Width.", "elementor"),
|
|
2601
2687
|
categories: ["best-practices", "performance"],
|
|
2602
2688
|
severity: "info",
|
|
2603
2689
|
weight: 5,
|
|
2604
2690
|
evaluate: (ctx) => {
|
|
2605
2691
|
if (ctx.elements.tree.length === 0) {
|
|
2606
|
-
return { status: "skipped", reason: (0,
|
|
2692
|
+
return { status: "skipped", reason: (0, import_i18n37.__)("No elements", "elementor") };
|
|
2607
2693
|
}
|
|
2608
2694
|
const violations = [];
|
|
2609
2695
|
walkElements(ctx.elements.tree, (node, parents) => {
|
|
@@ -2613,10 +2699,10 @@ var audit11 = {
|
|
|
2613
2699
|
const nearestContainerAncestor = [...parents].reverse().find((p) => p.elType === "container");
|
|
2614
2700
|
if (nearestContainerAncestor && isBoxed(nearestContainerAncestor.settings)) {
|
|
2615
2701
|
violations.push({
|
|
2616
|
-
auditId:
|
|
2702
|
+
auditId: audit13.id,
|
|
2617
2703
|
elementId: node.id,
|
|
2618
2704
|
targetHint: "element-settings",
|
|
2619
|
-
label: (0,
|
|
2705
|
+
label: (0, import_i18n37.__)("Nested boxed container.", "elementor")
|
|
2620
2706
|
});
|
|
2621
2707
|
}
|
|
2622
2708
|
});
|
|
@@ -2625,12 +2711,12 @@ var audit11 = {
|
|
|
2625
2711
|
};
|
|
2626
2712
|
|
|
2627
2713
|
// src/audits/page-excerpt.ts
|
|
2628
|
-
var
|
|
2629
|
-
var
|
|
2714
|
+
var import_i18n38 = require("@wordpress/i18n");
|
|
2715
|
+
var audit14 = {
|
|
2630
2716
|
id: "audits/page-excerpt",
|
|
2631
|
-
title: (0,
|
|
2632
|
-
description: (0,
|
|
2633
|
-
fixHint: (0,
|
|
2717
|
+
title: (0, import_i18n38.__)("Page excerpt", "elementor"),
|
|
2718
|
+
description: (0, import_i18n38.__)("A descriptive excerpt helps search engines and previews summarize the page.", "elementor"),
|
|
2719
|
+
fixHint: (0, import_i18n38.__)("Open Page Settings and write a short excerpt.", "elementor"),
|
|
2634
2720
|
categories: ["seo"],
|
|
2635
2721
|
severity: "warning",
|
|
2636
2722
|
weight: 5,
|
|
@@ -2642,8 +2728,8 @@ var audit12 = {
|
|
|
2642
2728
|
status: "fail",
|
|
2643
2729
|
violations: [
|
|
2644
2730
|
{
|
|
2645
|
-
auditId:
|
|
2646
|
-
label: (0,
|
|
2731
|
+
auditId: audit14.id,
|
|
2732
|
+
label: (0, import_i18n38.__)("Page has no excerpt.", "elementor"),
|
|
2647
2733
|
targetHint: "page-settings",
|
|
2648
2734
|
angieFix: true
|
|
2649
2735
|
}
|
|
@@ -2653,12 +2739,12 @@ var audit12 = {
|
|
|
2653
2739
|
};
|
|
2654
2740
|
|
|
2655
2741
|
// src/audits/page-featured-image.ts
|
|
2656
|
-
var
|
|
2657
|
-
var
|
|
2742
|
+
var import_i18n39 = require("@wordpress/i18n");
|
|
2743
|
+
var audit15 = {
|
|
2658
2744
|
id: "audits/page-featured-image",
|
|
2659
|
-
title: (0,
|
|
2660
|
-
description: (0,
|
|
2661
|
-
fixHint: (0,
|
|
2745
|
+
title: (0, import_i18n39.__)("Page featured image", "elementor"),
|
|
2746
|
+
description: (0, import_i18n39.__)("Featured images are used by social shares and many themes for hero visuals.", "elementor"),
|
|
2747
|
+
fixHint: (0, import_i18n39.__)("Open Page Settings and set a featured image.", "elementor"),
|
|
2662
2748
|
categories: ["seo"],
|
|
2663
2749
|
severity: "info",
|
|
2664
2750
|
weight: 5,
|
|
@@ -2670,8 +2756,8 @@ var audit13 = {
|
|
|
2670
2756
|
status: "fail",
|
|
2671
2757
|
violations: [
|
|
2672
2758
|
{
|
|
2673
|
-
auditId:
|
|
2674
|
-
label: (0,
|
|
2759
|
+
auditId: audit15.id,
|
|
2760
|
+
label: (0, import_i18n39.__)("No featured image set.", "elementor"),
|
|
2675
2761
|
targetHint: "page-settings"
|
|
2676
2762
|
}
|
|
2677
2763
|
]
|
|
@@ -2680,13 +2766,13 @@ var audit13 = {
|
|
|
2680
2766
|
};
|
|
2681
2767
|
|
|
2682
2768
|
// src/audits/page-title.ts
|
|
2683
|
-
var
|
|
2769
|
+
var import_i18n40 = require("@wordpress/i18n");
|
|
2684
2770
|
var MAX_TITLE_LENGTH = 60;
|
|
2685
|
-
var
|
|
2771
|
+
var audit16 = {
|
|
2686
2772
|
id: "audits/page-title",
|
|
2687
|
-
title: (0,
|
|
2688
|
-
description: (0,
|
|
2689
|
-
fixHint: (0,
|
|
2773
|
+
title: (0, import_i18n40.__)("Page title", "elementor"),
|
|
2774
|
+
description: (0, import_i18n40.__)("Pages need a clear title for SEO and screen-reader navigation.", "elementor"),
|
|
2775
|
+
fixHint: (0, import_i18n40.__)("Open Page Settings and add a title.", "elementor"),
|
|
2690
2776
|
categories: ["seo"],
|
|
2691
2777
|
severity: "error",
|
|
2692
2778
|
weight: 10,
|
|
@@ -2697,11 +2783,11 @@ var audit14 = {
|
|
|
2697
2783
|
status: "fail",
|
|
2698
2784
|
violations: [
|
|
2699
2785
|
{
|
|
2700
|
-
auditId:
|
|
2701
|
-
label: (0,
|
|
2786
|
+
auditId: audit16.id,
|
|
2787
|
+
label: (0, import_i18n40.__)("Page has no title.", "elementor"),
|
|
2702
2788
|
targetHint: "page-settings",
|
|
2703
2789
|
angieFix: true,
|
|
2704
|
-
angiePrompt: (0,
|
|
2790
|
+
angiePrompt: (0, import_i18n40.__)(
|
|
2705
2791
|
"Based on this page's contents, generate a title for this page.",
|
|
2706
2792
|
"elementor"
|
|
2707
2793
|
)
|
|
@@ -2714,8 +2800,8 @@ var audit14 = {
|
|
|
2714
2800
|
status: "fail",
|
|
2715
2801
|
violations: [
|
|
2716
2802
|
{
|
|
2717
|
-
auditId:
|
|
2718
|
-
label: (0,
|
|
2803
|
+
auditId: audit16.id,
|
|
2804
|
+
label: (0, import_i18n40.__)("Page title is too long.", "elementor"),
|
|
2719
2805
|
targetHint: "page-settings",
|
|
2720
2806
|
angieFix: true
|
|
2721
2807
|
}
|
|
@@ -2727,7 +2813,7 @@ var audit14 = {
|
|
|
2727
2813
|
};
|
|
2728
2814
|
|
|
2729
2815
|
// src/audits/prefer-global-colors.ts
|
|
2730
|
-
var
|
|
2816
|
+
var import_i18n41 = require("@wordpress/i18n");
|
|
2731
2817
|
|
|
2732
2818
|
// src/utils/collect-hardcoded-colors.ts
|
|
2733
2819
|
var RESERVED_SETTING_KEYS = /* @__PURE__ */ new Set(["__globals__", "__dynamic__"]);
|
|
@@ -2793,20 +2879,20 @@ function findMatchingGlobalByValue(value, globals) {
|
|
|
2793
2879
|
}
|
|
2794
2880
|
|
|
2795
2881
|
// src/audits/prefer-global-colors.ts
|
|
2796
|
-
var
|
|
2882
|
+
var audit17 = {
|
|
2797
2883
|
id: "audits/prefer-global-colors",
|
|
2798
|
-
title: (0,
|
|
2799
|
-
description: (0,
|
|
2800
|
-
fixHint: (0,
|
|
2884
|
+
title: (0, import_i18n41.__)("Prefer global colors", "elementor"),
|
|
2885
|
+
description: (0, import_i18n41.__)("Global colors make the design consistent and easy to update site-wide.", "elementor"),
|
|
2886
|
+
fixHint: (0, import_i18n41.__)("Replace the hard-coded value with the matching global color.", "elementor"),
|
|
2801
2887
|
categories: ["best-practices"],
|
|
2802
2888
|
severity: "info",
|
|
2803
2889
|
weight: 3,
|
|
2804
2890
|
evaluate: (ctx) => {
|
|
2805
2891
|
if (ctx.elements.tree.length === 0) {
|
|
2806
|
-
return { status: "skipped", reason: (0,
|
|
2892
|
+
return { status: "skipped", reason: (0, import_i18n41.__)("No elements", "elementor") };
|
|
2807
2893
|
}
|
|
2808
2894
|
if (ctx.kit.globals.colors.length === 0) {
|
|
2809
|
-
return { status: "skipped", reason: (0,
|
|
2895
|
+
return { status: "skipped", reason: (0, import_i18n41.__)("No global colors", "elementor") };
|
|
2810
2896
|
}
|
|
2811
2897
|
const violations = [];
|
|
2812
2898
|
walkElements(ctx.elements.tree, (node) => {
|
|
@@ -2816,13 +2902,13 @@ var audit15 = {
|
|
|
2816
2902
|
continue;
|
|
2817
2903
|
}
|
|
2818
2904
|
violations.push({
|
|
2819
|
-
auditId:
|
|
2905
|
+
auditId: audit17.id,
|
|
2820
2906
|
elementId: node.id,
|
|
2821
2907
|
targetHint: "element-settings",
|
|
2822
2908
|
angieFix: true,
|
|
2823
|
-
label: (0,
|
|
2909
|
+
label: (0, import_i18n41.sprintf)(
|
|
2824
2910
|
/* translators: 1: hard-coded color value, 2: global color title. */
|
|
2825
|
-
(0,
|
|
2911
|
+
(0, import_i18n41.__)('replace "%1$s" with "%2$s" global color', "elementor"),
|
|
2826
2912
|
value,
|
|
2827
2913
|
global.title
|
|
2828
2914
|
)
|
|
@@ -2834,7 +2920,7 @@ var audit15 = {
|
|
|
2834
2920
|
};
|
|
2835
2921
|
|
|
2836
2922
|
// src/audits/prefer-global-fonts.ts
|
|
2837
|
-
var
|
|
2923
|
+
var import_i18n42 = require("@wordpress/i18n");
|
|
2838
2924
|
|
|
2839
2925
|
// src/utils/collect-hardcoded-fonts.ts
|
|
2840
2926
|
var RESERVED_SETTING_KEYS2 = /* @__PURE__ */ new Set(["__globals__", "__dynamic__"]);
|
|
@@ -2892,20 +2978,20 @@ function collectHardcodedFonts(settings, pathPrefix = "") {
|
|
|
2892
2978
|
}
|
|
2893
2979
|
|
|
2894
2980
|
// src/audits/prefer-global-fonts.ts
|
|
2895
|
-
var
|
|
2981
|
+
var audit18 = {
|
|
2896
2982
|
id: "audits/prefer-global-fonts",
|
|
2897
|
-
title: (0,
|
|
2898
|
-
description: (0,
|
|
2899
|
-
fixHint: (0,
|
|
2983
|
+
title: (0, import_i18n42.__)("Prefer global fonts", "elementor"),
|
|
2984
|
+
description: (0, import_i18n42.__)("Global fonts make the design consistent and easy to update site-wide.", "elementor"),
|
|
2985
|
+
fixHint: (0, import_i18n42.__)("Replace the hard-coded value with the matching global font.", "elementor"),
|
|
2900
2986
|
categories: ["best-practices", "performance"],
|
|
2901
2987
|
severity: "info",
|
|
2902
2988
|
weight: 3,
|
|
2903
2989
|
evaluate: (ctx) => {
|
|
2904
2990
|
if (ctx.elements.tree.length === 0) {
|
|
2905
|
-
return { status: "skipped", reason: (0,
|
|
2991
|
+
return { status: "skipped", reason: (0, import_i18n42.__)("No elements", "elementor") };
|
|
2906
2992
|
}
|
|
2907
2993
|
if (ctx.kit.globals.fonts.length === 0) {
|
|
2908
|
-
return { status: "skipped", reason: (0,
|
|
2994
|
+
return { status: "skipped", reason: (0, import_i18n42.__)("No global fonts", "elementor") };
|
|
2909
2995
|
}
|
|
2910
2996
|
const violations = [];
|
|
2911
2997
|
walkElements(ctx.elements.tree, (node) => {
|
|
@@ -2915,12 +3001,12 @@ var audit16 = {
|
|
|
2915
3001
|
continue;
|
|
2916
3002
|
}
|
|
2917
3003
|
violations.push({
|
|
2918
|
-
auditId:
|
|
3004
|
+
auditId: audit18.id,
|
|
2919
3005
|
elementId: node.id,
|
|
2920
3006
|
targetHint: "element-settings",
|
|
2921
|
-
label: (0,
|
|
3007
|
+
label: (0, import_i18n42.sprintf)(
|
|
2922
3008
|
/* translators: %s: global font title. */
|
|
2923
|
-
(0,
|
|
3009
|
+
(0, import_i18n42.__)('replace hardcoded typography with "%s" global font', "elementor"),
|
|
2924
3010
|
global.title
|
|
2925
3011
|
)
|
|
2926
3012
|
});
|
|
@@ -2931,15 +3017,15 @@ var audit16 = {
|
|
|
2931
3017
|
};
|
|
2932
3018
|
|
|
2933
3019
|
// src/audits/privacy-policy.ts
|
|
2934
|
-
var
|
|
2935
|
-
var
|
|
3020
|
+
var import_i18n43 = require("@wordpress/i18n");
|
|
3021
|
+
var audit19 = {
|
|
2936
3022
|
id: "audits/privacy-policy",
|
|
2937
|
-
title: (0,
|
|
2938
|
-
description: (0,
|
|
3023
|
+
title: (0, import_i18n43.__)("Privacy policy", "elementor"),
|
|
3024
|
+
description: (0, import_i18n43.__)(
|
|
2939
3025
|
"A privacy policy page is required by privacy regulations such as GDPR (EU) and CCPA (US).",
|
|
2940
3026
|
"elementor"
|
|
2941
3027
|
),
|
|
2942
|
-
fixHint: (0,
|
|
3028
|
+
fixHint: (0, import_i18n43.__)(
|
|
2943
3029
|
"Go to Settings > Privacy in the WordPress admin and assign a published privacy policy page.",
|
|
2944
3030
|
"elementor"
|
|
2945
3031
|
),
|
|
@@ -2954,10 +3040,10 @@ var audit17 = {
|
|
|
2954
3040
|
status: "fail",
|
|
2955
3041
|
violations: [
|
|
2956
3042
|
{
|
|
2957
|
-
auditId:
|
|
2958
|
-
label: (0,
|
|
3043
|
+
auditId: audit19.id,
|
|
3044
|
+
label: (0, import_i18n43.__)("No privacy policy page is set.", "elementor"),
|
|
2959
3045
|
externalUrl: ctx.pageContext.privacy_settings_url,
|
|
2960
|
-
ctaLabel: (0,
|
|
3046
|
+
ctaLabel: (0, import_i18n43.__)("Create", "elementor")
|
|
2961
3047
|
}
|
|
2962
3048
|
]
|
|
2963
3049
|
};
|
|
@@ -2965,15 +3051,15 @@ var audit17 = {
|
|
|
2965
3051
|
};
|
|
2966
3052
|
|
|
2967
3053
|
// src/audits/robots-noindex.ts
|
|
2968
|
-
var
|
|
2969
|
-
var
|
|
3054
|
+
var import_i18n44 = require("@wordpress/i18n");
|
|
3055
|
+
var audit20 = {
|
|
2970
3056
|
id: "audits/robots-noindex",
|
|
2971
|
-
title: (0,
|
|
2972
|
-
description: (0,
|
|
3057
|
+
title: (0, import_i18n44.__)("Search engine visibility", "elementor"),
|
|
3058
|
+
description: (0, import_i18n44.__)(
|
|
2973
3059
|
"When search engine visibility is checked in WordPress Settings -> Reading -> Search Engine Visibility, search engines are discouraged from indexing the website.",
|
|
2974
3060
|
"elementor"
|
|
2975
3061
|
),
|
|
2976
|
-
fixHint: (0,
|
|
3062
|
+
fixHint: (0, import_i18n44.__)(
|
|
2977
3063
|
'Go to Settings \u2192 Reading in the WordPress admin and uncheck "Discourage search engines from indexing this site" when the website should be indexed.',
|
|
2978
3064
|
"elementor"
|
|
2979
3065
|
),
|
|
@@ -2988,8 +3074,8 @@ var audit18 = {
|
|
|
2988
3074
|
status: "fail",
|
|
2989
3075
|
violations: [
|
|
2990
3076
|
{
|
|
2991
|
-
auditId:
|
|
2992
|
-
label: (0,
|
|
3077
|
+
auditId: audit20.id,
|
|
3078
|
+
label: (0, import_i18n44.__)("Search engines are discouraged from indexing this website.", "elementor"),
|
|
2993
3079
|
externalUrl: ctx.pageContext.reading_settings_url
|
|
2994
3080
|
}
|
|
2995
3081
|
]
|
|
@@ -2998,15 +3084,15 @@ var audit18 = {
|
|
|
2998
3084
|
};
|
|
2999
3085
|
|
|
3000
3086
|
// src/audits/scan-for-cookies.ts
|
|
3001
|
-
var
|
|
3002
|
-
var
|
|
3087
|
+
var import_i18n45 = require("@wordpress/i18n");
|
|
3088
|
+
var audit21 = {
|
|
3003
3089
|
id: "audits/scan-for-cookies",
|
|
3004
|
-
title: (0,
|
|
3005
|
-
description: (0,
|
|
3090
|
+
title: (0, import_i18n45.__)("Scan for cookies", "elementor"),
|
|
3091
|
+
description: (0, import_i18n45.__)(
|
|
3006
3092
|
"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.",
|
|
3007
3093
|
"elementor"
|
|
3008
3094
|
),
|
|
3009
|
-
fixHint: (0,
|
|
3095
|
+
fixHint: (0, import_i18n45.__)("Run a Cookiez scan on this page to see which cookies need disclosure.", "elementor"),
|
|
3010
3096
|
categories: ["compliance"],
|
|
3011
3097
|
severity: "info",
|
|
3012
3098
|
weight: 0,
|
|
@@ -3016,8 +3102,8 @@ var audit19 = {
|
|
|
3016
3102
|
status: "fail",
|
|
3017
3103
|
violations: [
|
|
3018
3104
|
{
|
|
3019
|
-
auditId:
|
|
3020
|
-
label: (0,
|
|
3105
|
+
auditId: audit21.id,
|
|
3106
|
+
label: (0, import_i18n45.__)("This page has not been scanned for cookies yet.", "elementor"),
|
|
3021
3107
|
externalUrl: isReady ? ctx.pageContext.cookiez_scan_url : ctx.pageContext.cookiez_plugin_action_url
|
|
3022
3108
|
}
|
|
3023
3109
|
]
|
|
@@ -3026,29 +3112,29 @@ var audit19 = {
|
|
|
3026
3112
|
};
|
|
3027
3113
|
|
|
3028
3114
|
// src/audits/sections-and-columns.ts
|
|
3029
|
-
var
|
|
3030
|
-
var
|
|
3115
|
+
var import_i18n46 = require("@wordpress/i18n");
|
|
3116
|
+
var audit22 = {
|
|
3031
3117
|
id: "audits/sections-and-columns",
|
|
3032
|
-
title: (0,
|
|
3033
|
-
description: (0,
|
|
3118
|
+
title: (0, import_i18n46.__)("Sections and columns", "elementor"),
|
|
3119
|
+
description: (0, import_i18n46.__)(
|
|
3034
3120
|
"Sections and columns are legacy elements. Containers render fewer DOM nodes and are more flexible.",
|
|
3035
3121
|
"elementor"
|
|
3036
3122
|
),
|
|
3037
|
-
fixHint: (0,
|
|
3123
|
+
fixHint: (0, import_i18n46.__)("Use the Container Converter to replace each section/column with a container.", "elementor"),
|
|
3038
3124
|
categories: ["best-practices", "performance"],
|
|
3039
3125
|
severity: "warning",
|
|
3040
3126
|
weight: 7,
|
|
3041
3127
|
evaluate: (ctx) => {
|
|
3042
3128
|
if (ctx.elements.tree.length === 0) {
|
|
3043
|
-
return { status: "skipped", reason: (0,
|
|
3129
|
+
return { status: "skipped", reason: (0, import_i18n46.__)("No elements", "elementor") };
|
|
3044
3130
|
}
|
|
3045
3131
|
const violations = [];
|
|
3046
3132
|
walkElements(ctx.elements.tree, (node) => {
|
|
3047
3133
|
if (node.elType === "section" || node.elType === "column") {
|
|
3048
3134
|
violations.push({
|
|
3049
|
-
auditId:
|
|
3135
|
+
auditId: audit22.id,
|
|
3050
3136
|
elementId: node.id,
|
|
3051
|
-
label: node.elType === "section" ? (0,
|
|
3137
|
+
label: node.elType === "section" ? (0, import_i18n46.__)("Section element", "elementor") : (0, import_i18n46.__)("Column element", "elementor")
|
|
3052
3138
|
});
|
|
3053
3139
|
}
|
|
3054
3140
|
});
|
|
@@ -3057,15 +3143,15 @@ var audit20 = {
|
|
|
3057
3143
|
};
|
|
3058
3144
|
|
|
3059
3145
|
// src/audits/site-identity.ts
|
|
3060
|
-
var
|
|
3061
|
-
var
|
|
3146
|
+
var import_i18n47 = require("@wordpress/i18n");
|
|
3147
|
+
var audit23 = {
|
|
3062
3148
|
id: "audits/site-identity",
|
|
3063
|
-
title: (0,
|
|
3064
|
-
description: (0,
|
|
3149
|
+
title: (0, import_i18n47.__)("Site identity", "elementor"),
|
|
3150
|
+
description: (0, import_i18n47.__)(
|
|
3065
3151
|
"Site name, description, logo, and favicon establish your brand and appear in search results and browser tabs.",
|
|
3066
3152
|
"elementor"
|
|
3067
3153
|
),
|
|
3068
|
-
fixHint: (0,
|
|
3154
|
+
fixHint: (0, import_i18n47.__)("Open Site Settings \u2192 Site Identity and complete all the missing fields.", "elementor"),
|
|
3069
3155
|
categories: ["best-practices", "seo"],
|
|
3070
3156
|
severity: "info",
|
|
3071
3157
|
weight: 7,
|
|
@@ -3074,30 +3160,30 @@ var audit21 = {
|
|
|
3074
3160
|
const violations = [];
|
|
3075
3161
|
if (!identity.site_name_set) {
|
|
3076
3162
|
violations.push({
|
|
3077
|
-
auditId:
|
|
3078
|
-
label: (0,
|
|
3163
|
+
auditId: audit23.id,
|
|
3164
|
+
label: (0, import_i18n47.__)("Site name is missing or still uses the default.", "elementor"),
|
|
3079
3165
|
targetHint: "site-identity-settings"
|
|
3080
3166
|
});
|
|
3081
3167
|
}
|
|
3082
3168
|
if (!identity.site_description_set) {
|
|
3083
3169
|
violations.push({
|
|
3084
|
-
auditId:
|
|
3085
|
-
label: (0,
|
|
3170
|
+
auditId: audit23.id,
|
|
3171
|
+
label: (0, import_i18n47.__)("Site description is missing or still uses the default.", "elementor"),
|
|
3086
3172
|
targetHint: "site-identity-settings",
|
|
3087
3173
|
angieFix: true
|
|
3088
3174
|
});
|
|
3089
3175
|
}
|
|
3090
3176
|
if (!identity.site_logo_set) {
|
|
3091
3177
|
violations.push({
|
|
3092
|
-
auditId:
|
|
3093
|
-
label: (0,
|
|
3178
|
+
auditId: audit23.id,
|
|
3179
|
+
label: (0, import_i18n47.__)("Site logo is not set.", "elementor"),
|
|
3094
3180
|
targetHint: "site-identity-settings"
|
|
3095
3181
|
});
|
|
3096
3182
|
}
|
|
3097
3183
|
if (!identity.site_favicon_set) {
|
|
3098
3184
|
violations.push({
|
|
3099
|
-
auditId:
|
|
3100
|
-
label: (0,
|
|
3185
|
+
auditId: audit23.id,
|
|
3186
|
+
label: (0, import_i18n47.__)("Site favicon is not set.", "elementor"),
|
|
3101
3187
|
targetHint: "site-identity-settings"
|
|
3102
3188
|
});
|
|
3103
3189
|
}
|
|
@@ -3113,7 +3199,7 @@ var audit21 = {
|
|
|
3113
3199
|
|
|
3114
3200
|
// src/audits/too-many-widgets.ts
|
|
3115
3201
|
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
3116
|
-
var
|
|
3202
|
+
var import_i18n48 = require("@wordpress/i18n");
|
|
3117
3203
|
var WIDGET_COUNT_THRESHOLD = 100;
|
|
3118
3204
|
function isCountableWidget(node, widgetsCache) {
|
|
3119
3205
|
if (node.elType === "widget") {
|
|
@@ -3121,17 +3207,17 @@ function isCountableWidget(node, widgetsCache) {
|
|
|
3121
3207
|
}
|
|
3122
3208
|
return !!widgetsCache?.[node.elType]?.meta?.is_compound;
|
|
3123
3209
|
}
|
|
3124
|
-
var
|
|
3210
|
+
var audit24 = {
|
|
3125
3211
|
id: "audits/too-many-widgets",
|
|
3126
|
-
title: (0,
|
|
3127
|
-
description: (0,
|
|
3128
|
-
fixHint: (0,
|
|
3212
|
+
title: (0, import_i18n48.__)("Too many widgets", "elementor"),
|
|
3213
|
+
description: (0, import_i18n48.__)("Excessive DOM size caused by too many widgets degrades rendering performance.", "elementor"),
|
|
3214
|
+
fixHint: (0, import_i18n48.__)("Reduce the number of widgets on the page by removing or combining elements.", "elementor"),
|
|
3129
3215
|
categories: ["best-practices", "performance"],
|
|
3130
3216
|
severity: "warning",
|
|
3131
3217
|
weight: 5,
|
|
3132
3218
|
evaluate: (ctx) => {
|
|
3133
3219
|
if (ctx.elements.tree.length === 0) {
|
|
3134
|
-
return { status: "skipped", reason: (0,
|
|
3220
|
+
return { status: "skipped", reason: (0, import_i18n48.__)("No elements", "elementor") };
|
|
3135
3221
|
}
|
|
3136
3222
|
const widgetsCache = (0, import_editor_elements9.getWidgetsCache)();
|
|
3137
3223
|
let widgetCount = 0;
|
|
@@ -3147,8 +3233,8 @@ var audit22 = {
|
|
|
3147
3233
|
status: "fail",
|
|
3148
3234
|
violations: [
|
|
3149
3235
|
{
|
|
3150
|
-
auditId:
|
|
3151
|
-
label: (0,
|
|
3236
|
+
auditId: audit24.id,
|
|
3237
|
+
label: (0, import_i18n48.__)("Page has too many widgets.", "elementor")
|
|
3152
3238
|
}
|
|
3153
3239
|
]
|
|
3154
3240
|
};
|
|
@@ -3157,32 +3243,34 @@ var audit22 = {
|
|
|
3157
3243
|
|
|
3158
3244
|
// src/register-audits.ts
|
|
3159
3245
|
var AUDITS = [
|
|
3246
|
+
audit16,
|
|
3160
3247
|
audit14,
|
|
3161
|
-
audit12,
|
|
3162
|
-
audit13,
|
|
3163
|
-
audit8,
|
|
3164
|
-
audit5,
|
|
3165
|
-
audit22,
|
|
3166
|
-
audit20,
|
|
3167
|
-
audit3,
|
|
3168
|
-
audit11,
|
|
3169
|
-
audit4,
|
|
3170
|
-
audit21,
|
|
3171
3248
|
audit15,
|
|
3172
|
-
audit16,
|
|
3173
|
-
audit7,
|
|
3174
|
-
audit9,
|
|
3175
3249
|
audit10,
|
|
3176
|
-
|
|
3250
|
+
audit7,
|
|
3251
|
+
audit24,
|
|
3252
|
+
audit22,
|
|
3253
|
+
audit5,
|
|
3254
|
+
audit13,
|
|
3255
|
+
audit6,
|
|
3256
|
+
audit23,
|
|
3177
3257
|
audit17,
|
|
3258
|
+
audit18,
|
|
3259
|
+
audit9,
|
|
3260
|
+
audit11,
|
|
3261
|
+
audit12,
|
|
3262
|
+
audit20,
|
|
3263
|
+
audit19,
|
|
3178
3264
|
audit,
|
|
3179
3265
|
audit2,
|
|
3180
|
-
|
|
3181
|
-
|
|
3266
|
+
audit3,
|
|
3267
|
+
audit4,
|
|
3268
|
+
audit21,
|
|
3269
|
+
audit8
|
|
3182
3270
|
];
|
|
3183
3271
|
function registerAllAudits() {
|
|
3184
|
-
for (const
|
|
3185
|
-
registerAudit(
|
|
3272
|
+
for (const audit25 of AUDITS) {
|
|
3273
|
+
registerAudit(audit25);
|
|
3186
3274
|
}
|
|
3187
3275
|
}
|
|
3188
3276
|
|