@elementor/editor-audits 4.4.0-1075 → 4.4.0-1077
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 +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +262 -187
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +225 -150
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
- package/src/audits/privacy-policy.ts +1 -0
- package/src/audits/scan-for-cookies.ts +30 -0
- package/src/components/status-section.tsx +1 -1
- package/src/components/violation-cta-button.tsx +22 -0
- package/src/components/violation-row.tsx +19 -4
- package/src/register-audits.ts +2 -0
- package/src/register-promotions.ts +8 -0
- package/src/types.ts +4 -0
- package/src/utils/audit-status-summary.ts +11 -2
- package/src/utils/is-scored-audit.ts +5 -0
- package/src/utils/severity-counts.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -51,10 +51,10 @@ var import_i18n22 = require("@wordpress/i18n");
|
|
|
51
51
|
var import_editor_floating_panels2 = require("@elementor/editor-floating-panels");
|
|
52
52
|
|
|
53
53
|
// src/components/audit-panel.tsx
|
|
54
|
-
var
|
|
54
|
+
var React23 = __toESM(require("react"));
|
|
55
55
|
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
56
56
|
var import_editor_floating_panels = require("@elementor/editor-floating-panels");
|
|
57
|
-
var
|
|
57
|
+
var import_ui22 = require("@elementor/ui");
|
|
58
58
|
var import_i18n21 = require("@wordpress/i18n");
|
|
59
59
|
|
|
60
60
|
// src/hooks/use-audit-report.ts
|
|
@@ -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(audit22) {
|
|
145
|
+
registry.set(audit22.id, audit22);
|
|
146
146
|
}
|
|
147
147
|
function getRegisteredAudits() {
|
|
148
148
|
return Array.from(registry.values());
|
|
@@ -178,6 +178,11 @@ var CATEGORY_LABELS = {
|
|
|
178
178
|
// src/utils/audit-status-summary.ts
|
|
179
179
|
var import_i18n2 = require("@wordpress/i18n");
|
|
180
180
|
|
|
181
|
+
// src/utils/is-scored-audit.ts
|
|
182
|
+
function isScoredAudit(audit22) {
|
|
183
|
+
return audit22.weight > 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
181
186
|
// src/utils/sort-failed-audits.ts
|
|
182
187
|
var SEVERITY_SORTING_RANK = {
|
|
183
188
|
error: 0,
|
|
@@ -208,7 +213,9 @@ function partitionAuditResults(report, options = {}) {
|
|
|
208
213
|
switch (run.result.status) {
|
|
209
214
|
case "fail":
|
|
210
215
|
failed.push({ ...run, result: run.result });
|
|
211
|
-
|
|
216
|
+
if (isScoredAudit(run.audit)) {
|
|
217
|
+
totalViolations += run.result.violations.length;
|
|
218
|
+
}
|
|
212
219
|
break;
|
|
213
220
|
case "pass":
|
|
214
221
|
passed.push({ ...run, result: run.result });
|
|
@@ -229,7 +236,10 @@ function auditStatusDisplayCounts(report) {
|
|
|
229
236
|
let pass = 0;
|
|
230
237
|
let skipped = 0;
|
|
231
238
|
let totalViolations = 0;
|
|
232
|
-
for (const { result } of report.auditResults) {
|
|
239
|
+
for (const { audit: audit22, result } of report.auditResults) {
|
|
240
|
+
if (!isScoredAudit(audit22)) {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
233
243
|
switch (result.status) {
|
|
234
244
|
case "fail":
|
|
235
245
|
totalViolations += result.violations.length;
|
|
@@ -277,16 +287,16 @@ function computeReport(documentId, results) {
|
|
|
277
287
|
const accumulators = Object.fromEntries(
|
|
278
288
|
ALL_CATEGORIES.map((c) => [c, { totalWeight: 0, passedWeight: 0, total: 0, failed: 0 }])
|
|
279
289
|
);
|
|
280
|
-
for (const { audit:
|
|
290
|
+
for (const { audit: audit22, result } of results) {
|
|
281
291
|
if (result.status === "skipped") {
|
|
282
292
|
continue;
|
|
283
293
|
}
|
|
284
|
-
for (const category of
|
|
294
|
+
for (const category of audit22.categories) {
|
|
285
295
|
const acc = accumulators[category];
|
|
286
296
|
acc.total++;
|
|
287
|
-
acc.totalWeight +=
|
|
297
|
+
acc.totalWeight += audit22.weight;
|
|
288
298
|
if (result.status === "pass") {
|
|
289
|
-
acc.passedWeight +=
|
|
299
|
+
acc.passedWeight += audit22.weight;
|
|
290
300
|
} else {
|
|
291
301
|
acc.failed++;
|
|
292
302
|
}
|
|
@@ -475,10 +485,10 @@ async function runPageAudit(documentId) {
|
|
|
475
485
|
const ctx = { documentId, elements, pageContext, kit };
|
|
476
486
|
const registered = getRegisteredAudits();
|
|
477
487
|
const auditResults = await Promise.all(
|
|
478
|
-
registered.map(async (
|
|
479
|
-
const { evaluate: _evaluate, ...meta } =
|
|
488
|
+
registered.map(async (audit22) => {
|
|
489
|
+
const { evaluate: _evaluate, ...meta } = audit22;
|
|
480
490
|
try {
|
|
481
|
-
const result = await
|
|
491
|
+
const result = await audit22.evaluate(ctx);
|
|
482
492
|
return { audit: meta, result };
|
|
483
493
|
} catch (error) {
|
|
484
494
|
const reason = error instanceof Error ? error.message : "unknown-error";
|
|
@@ -749,14 +759,14 @@ function WelcomePage() {
|
|
|
749
759
|
}
|
|
750
760
|
|
|
751
761
|
// src/components/report-shell.tsx
|
|
752
|
-
var
|
|
762
|
+
var React22 = __toESM(require("react"));
|
|
753
763
|
var import_react5 = require("react");
|
|
754
|
-
var
|
|
764
|
+
var import_ui21 = require("@elementor/ui");
|
|
755
765
|
var import_i18n20 = require("@wordpress/i18n");
|
|
756
766
|
|
|
757
767
|
// src/components/pages/all-audits-page.tsx
|
|
758
|
-
var
|
|
759
|
-
var
|
|
768
|
+
var React12 = __toESM(require("react"));
|
|
769
|
+
var import_ui11 = require("@elementor/ui");
|
|
760
770
|
var import_i18n12 = require("@wordpress/i18n");
|
|
761
771
|
|
|
762
772
|
// src/components/status-section.tsx
|
|
@@ -767,7 +777,7 @@ var import_ui5 = require("@elementor/ui");
|
|
|
767
777
|
var import_i18n7 = require("@wordpress/i18n");
|
|
768
778
|
function StatusSection({ label, count, color = "default", defaultExpanded = false, children }) {
|
|
769
779
|
const [expanded, setExpanded] = (0, import_react3.useState)(defaultExpanded);
|
|
770
|
-
if (count === 0) {
|
|
780
|
+
if (React5.Children.count(children) === 0) {
|
|
771
781
|
return null;
|
|
772
782
|
}
|
|
773
783
|
return /* @__PURE__ */ React5.createElement(import_ui5.Box, { sx: { paddingBlock: 1 } }, /* @__PURE__ */ React5.createElement(
|
|
@@ -808,11 +818,11 @@ function SubpageHeader({ title, onBack, backLabel, icon }) {
|
|
|
808
818
|
}
|
|
809
819
|
|
|
810
820
|
// src/components/violation-row.tsx
|
|
811
|
-
var
|
|
821
|
+
var React11 = __toESM(require("react"));
|
|
812
822
|
var import_react4 = require("react");
|
|
813
823
|
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
814
824
|
var import_icons7 = require("@elementor/icons");
|
|
815
|
-
var
|
|
825
|
+
var import_ui10 = require("@elementor/ui");
|
|
816
826
|
var import_i18n11 = require("@wordpress/i18n");
|
|
817
827
|
|
|
818
828
|
// src/hooks/focus-violation.ts
|
|
@@ -925,14 +935,26 @@ function SeverityIcon({ severity }) {
|
|
|
925
935
|
return /* @__PURE__ */ React8.createElement(Icon, { fontSize: "small", color });
|
|
926
936
|
}
|
|
927
937
|
|
|
928
|
-
// src/components/violation-
|
|
938
|
+
// src/components/violation-cta-button.tsx
|
|
929
939
|
var React9 = __toESM(require("react"));
|
|
930
|
-
var import_icons6 = require("@elementor/icons");
|
|
931
940
|
var import_ui8 = require("@elementor/ui");
|
|
941
|
+
function ViolationCtaButton({ ctaLabel, externalUrl }) {
|
|
942
|
+
const handleClick = (event) => {
|
|
943
|
+
event.stopPropagation();
|
|
944
|
+
event.preventDefault();
|
|
945
|
+
window.open(externalUrl, "_blank", "noopener");
|
|
946
|
+
};
|
|
947
|
+
return /* @__PURE__ */ React9.createElement(import_ui8.Button, { variant: "outlined", color: "secondary", size: "small", onClick: handleClick }, ctaLabel);
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
// src/components/violation-icons.tsx
|
|
951
|
+
var React10 = __toESM(require("react"));
|
|
952
|
+
var import_icons6 = require("@elementor/icons");
|
|
953
|
+
var import_ui9 = require("@elementor/ui");
|
|
932
954
|
function ViolationIcon({ violation, widgetIcon }) {
|
|
933
955
|
if (widgetIcon) {
|
|
934
|
-
return /* @__PURE__ */
|
|
935
|
-
|
|
956
|
+
return /* @__PURE__ */ React10.createElement(
|
|
957
|
+
import_ui9.Box,
|
|
936
958
|
{
|
|
937
959
|
component: "i",
|
|
938
960
|
className: widgetIcon,
|
|
@@ -942,29 +964,29 @@ function ViolationIcon({ violation, widgetIcon }) {
|
|
|
942
964
|
);
|
|
943
965
|
}
|
|
944
966
|
if (violation.targetHint === "page-settings") {
|
|
945
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ React10.createElement(import_icons6.FileSettingsIcon, { fontSize: "inherit", "aria-hidden": true });
|
|
946
968
|
}
|
|
947
969
|
if (violation.targetHint === "site-settings" || violation.targetHint === "site-identity-settings") {
|
|
948
|
-
return /* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ React10.createElement(import_icons6.SettingsIcon, { fontSize: "inherit", "aria-hidden": true });
|
|
949
971
|
}
|
|
950
|
-
return /* @__PURE__ */
|
|
972
|
+
return /* @__PURE__ */ React10.createElement(import_icons6.ShieldCheckIcon, { fontSize: "inherit", "aria-hidden": true });
|
|
951
973
|
}
|
|
952
974
|
|
|
953
975
|
// src/components/violation-row.tsx
|
|
954
976
|
function SkipReasonTooltip({ reason }) {
|
|
955
|
-
return /* @__PURE__ */
|
|
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" })));
|
|
956
978
|
}
|
|
957
|
-
function StatusIndicator({ audit:
|
|
979
|
+
function StatusIndicator({ audit: audit22, violations }) {
|
|
958
980
|
if (violations) {
|
|
959
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, isScoredAudit(audit22) && /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", color: "text.secondary", fontWeight: "bold" }, violations.length), /* @__PURE__ */ React11.createElement(SeverityIcon, { severity: audit22.severity }));
|
|
960
982
|
}
|
|
961
|
-
return /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */ React11.createElement(import_icons7.CheckIcon, { fontSize: "small", color: "success" });
|
|
962
984
|
}
|
|
963
|
-
function ViolationRow({ audit:
|
|
985
|
+
function ViolationRow({ audit: audit22, skipReason, violations }) {
|
|
964
986
|
const [expanded, setExpanded] = (0, import_react4.useState)(false);
|
|
965
987
|
const toggleExpanded = () => setExpanded((value) => !value);
|
|
966
|
-
return /* @__PURE__ */
|
|
967
|
-
|
|
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(
|
|
989
|
+
import_ui10.Box,
|
|
968
990
|
{
|
|
969
991
|
sx: {
|
|
970
992
|
alignItems: "center",
|
|
@@ -976,16 +998,16 @@ function ViolationRow({ audit: audit21, skipReason, violations }) {
|
|
|
976
998
|
},
|
|
977
999
|
onClick: toggleExpanded
|
|
978
1000
|
},
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
!skipReason && /* @__PURE__ */
|
|
981
|
-
), skipReason && /* @__PURE__ */
|
|
982
|
-
|
|
1001
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "body2", sx: { flex: 1 } }, audit22.title),
|
|
1002
|
+
!skipReason && /* @__PURE__ */ React11.createElement(StatusIndicator, { audit: audit22, violations })
|
|
1003
|
+
), skipReason && /* @__PURE__ */ React11.createElement(SkipReasonTooltip, { reason: skipReason }), /* @__PURE__ */ React11.createElement(
|
|
1004
|
+
import_ui10.IconButton,
|
|
983
1005
|
{
|
|
984
1006
|
size: "small",
|
|
985
1007
|
"aria-label": expanded ? (0, import_i18n11.__)("Collapse", "elementor") : (0, import_i18n11.__)("Expand", "elementor"),
|
|
986
1008
|
onClick: toggleExpanded
|
|
987
1009
|
},
|
|
988
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ React11.createElement(
|
|
989
1011
|
import_icons7.ChevronDownIcon,
|
|
990
1012
|
{
|
|
991
1013
|
fontSize: "small",
|
|
@@ -995,30 +1017,30 @@ function ViolationRow({ audit: audit21, skipReason, violations }) {
|
|
|
995
1017
|
}
|
|
996
1018
|
}
|
|
997
1019
|
)
|
|
998
|
-
)), /* @__PURE__ */
|
|
999
|
-
|
|
1020
|
+
)), /* @__PURE__ */ React11.createElement(import_ui10.Collapse, { in: expanded }, /* @__PURE__ */ React11.createElement(import_ui10.Box, { sx: { display: "flex", flexDirection: "column", gap: 1, paddingBlock: 1 } }, /* @__PURE__ */ React11.createElement(
|
|
1021
|
+
import_ui10.Alert,
|
|
1000
1022
|
{
|
|
1001
1023
|
severity: "secondary",
|
|
1002
1024
|
sx: { p: 1 },
|
|
1003
|
-
icon: /* @__PURE__ */
|
|
1025
|
+
icon: /* @__PURE__ */ React11.createElement(import_icons7.AlertCircleIcon, { fontSize: "small", color: "secondary", "aria-hidden": true })
|
|
1004
1026
|
},
|
|
1005
|
-
/* @__PURE__ */
|
|
1006
|
-
/* @__PURE__ */
|
|
1007
|
-
), /* @__PURE__ */
|
|
1008
|
-
|
|
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" }, audit22.description)
|
|
1029
|
+
), /* @__PURE__ */ React11.createElement(
|
|
1030
|
+
import_ui10.Alert,
|
|
1009
1031
|
{
|
|
1010
1032
|
severity: "info",
|
|
1011
1033
|
sx: { p: 1 },
|
|
1012
|
-
icon: /* @__PURE__ */
|
|
1034
|
+
icon: /* @__PURE__ */ React11.createElement(import_icons7.BulbIcon, { fontSize: "small", color: "info", "aria-hidden": true })
|
|
1013
1035
|
},
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
)), violations && violations.length > 0 && /* @__PURE__ */
|
|
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" }, audit22.fixHint)
|
|
1038
|
+
)), violations && violations.length > 0 && /* @__PURE__ */ React11.createElement(import_ui10.Box, { role: "list", sx: { paddingBlockEnd: 1, paddingInlineStart: 2 } }, violations.map((violation, idx) => {
|
|
1017
1039
|
const widgetIcon = violation.elementId ? (0, import_editor_elements4.getElementIcon)(violation.elementId) : null;
|
|
1018
1040
|
const elementTitle = violation.elementId ? (0, import_editor_elements4.getElementTitle)(violation.elementId) : null;
|
|
1019
1041
|
const rowLabel = elementTitle ? `${elementTitle} - ${violation.label}` : violation.label;
|
|
1020
|
-
return /* @__PURE__ */
|
|
1021
|
-
|
|
1042
|
+
return /* @__PURE__ */ React11.createElement(
|
|
1043
|
+
import_ui10.Box,
|
|
1022
1044
|
{
|
|
1023
1045
|
key: idx,
|
|
1024
1046
|
role: "button",
|
|
@@ -1040,10 +1062,23 @@ function ViolationRow({ audit: audit21, skipReason, violations }) {
|
|
|
1040
1062
|
}
|
|
1041
1063
|
}
|
|
1042
1064
|
},
|
|
1043
|
-
/* @__PURE__ */
|
|
1044
|
-
/* @__PURE__ */
|
|
1045
|
-
violation.angieFix && /* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1065
|
+
/* @__PURE__ */ React11.createElement(ViolationIcon, { violation, widgetIcon }),
|
|
1066
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Box, { sx: { flex: 1 } }, /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption" }, rowLabel), violation.detail && /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", color: "text.secondary" }, violation.detail)),
|
|
1067
|
+
violation.angieFix && /* @__PURE__ */ React11.createElement(FixViolationWithAngie, { prompt: buildAngiePrompt(rowLabel) }),
|
|
1068
|
+
violation.ctaLabel && violation.externalUrl ? /* @__PURE__ */ React11.createElement(
|
|
1069
|
+
ViolationCtaButton,
|
|
1070
|
+
{
|
|
1071
|
+
ctaLabel: violation.ctaLabel,
|
|
1072
|
+
externalUrl: violation.externalUrl
|
|
1073
|
+
}
|
|
1074
|
+
) : /* @__PURE__ */ React11.createElement(
|
|
1075
|
+
import_icons7.EyeIcon,
|
|
1076
|
+
{
|
|
1077
|
+
className: "violation-hover-icon",
|
|
1078
|
+
fontSize: "tiny",
|
|
1079
|
+
"aria-hidden": true
|
|
1080
|
+
}
|
|
1081
|
+
)
|
|
1047
1082
|
);
|
|
1048
1083
|
}))));
|
|
1049
1084
|
}
|
|
@@ -1054,7 +1089,7 @@ function AllAuditsPage({ initialExpandedStatus, onBack, report }) {
|
|
|
1054
1089
|
const expandFail = !initialExpandedStatus || initialExpandedStatus === "fail";
|
|
1055
1090
|
const expandPass = initialExpandedStatus === "pass";
|
|
1056
1091
|
const expandSkipped = initialExpandedStatus === "skipped";
|
|
1057
|
-
return /* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ React12.createElement(import_ui11.Box, { key: initialExpandedStatus ?? "default" }, /* @__PURE__ */ React12.createElement(SubpageHeader, { title: (0, import_i18n12.__)("All audits", "elementor"), onBack }), /* @__PURE__ */ React12.createElement(import_ui11.Box, { sx: { p: 1 } }, /* @__PURE__ */ React12.createElement(
|
|
1058
1093
|
StatusSection,
|
|
1059
1094
|
{
|
|
1060
1095
|
label: auditStatusLabel("fail"),
|
|
@@ -1062,8 +1097,8 @@ function AllAuditsPage({ initialExpandedStatus, onBack, report }) {
|
|
|
1062
1097
|
color: auditStatusColor("fail"),
|
|
1063
1098
|
defaultExpanded: expandFail
|
|
1064
1099
|
},
|
|
1065
|
-
failed.map((r) => /* @__PURE__ */
|
|
1066
|
-
), /* @__PURE__ */
|
|
1100
|
+
failed.map((r) => /* @__PURE__ */ React12.createElement(ViolationRow, { key: r.audit.id, audit: r.audit, violations: r.result.violations }))
|
|
1101
|
+
), /* @__PURE__ */ React12.createElement(
|
|
1067
1102
|
StatusSection,
|
|
1068
1103
|
{
|
|
1069
1104
|
label: auditStatusLabel("pass"),
|
|
@@ -1071,8 +1106,8 @@ function AllAuditsPage({ initialExpandedStatus, onBack, report }) {
|
|
|
1071
1106
|
color: auditStatusColor("pass"),
|
|
1072
1107
|
defaultExpanded: expandPass
|
|
1073
1108
|
},
|
|
1074
|
-
passed.map((r) => /* @__PURE__ */
|
|
1075
|
-
), /* @__PURE__ */
|
|
1109
|
+
passed.map((r) => /* @__PURE__ */ React12.createElement(ViolationRow, { key: r.audit.id, audit: r.audit }))
|
|
1110
|
+
), /* @__PURE__ */ React12.createElement(
|
|
1076
1111
|
StatusSection,
|
|
1077
1112
|
{
|
|
1078
1113
|
label: auditStatusLabel("skipped"),
|
|
@@ -1080,13 +1115,13 @@ function AllAuditsPage({ initialExpandedStatus, onBack, report }) {
|
|
|
1080
1115
|
color: auditStatusColor("skipped"),
|
|
1081
1116
|
defaultExpanded: expandSkipped
|
|
1082
1117
|
},
|
|
1083
|
-
skipped.map((r) => /* @__PURE__ */
|
|
1118
|
+
skipped.map((r) => /* @__PURE__ */ React12.createElement(ViolationRow, { key: r.audit.id, audit: r.audit, skipReason: r.result.reason }))
|
|
1084
1119
|
)));
|
|
1085
1120
|
}
|
|
1086
1121
|
|
|
1087
1122
|
// src/components/pages/category-page.tsx
|
|
1088
|
-
var
|
|
1089
|
-
var
|
|
1123
|
+
var React13 = __toESM(require("react"));
|
|
1124
|
+
var import_ui12 = require("@elementor/ui");
|
|
1090
1125
|
var import_i18n13 = require("@wordpress/i18n");
|
|
1091
1126
|
|
|
1092
1127
|
// src/components/category-icons.ts
|
|
@@ -1103,15 +1138,15 @@ var CATEGORY_ICONS = {
|
|
|
1103
1138
|
function CategoryPage({ category, report, onBack }) {
|
|
1104
1139
|
const Icon = CATEGORY_ICONS[category];
|
|
1105
1140
|
const { failed, passed, totalViolations } = partitionAuditResults(report, { category });
|
|
1106
|
-
return /* @__PURE__ */
|
|
1141
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
|
|
1107
1142
|
SubpageHeader,
|
|
1108
1143
|
{
|
|
1109
1144
|
title: CATEGORY_LABELS[category],
|
|
1110
1145
|
onBack,
|
|
1111
1146
|
backLabel: (0, import_i18n13.__)("Back to all issues", "elementor"),
|
|
1112
|
-
icon: /* @__PURE__ */
|
|
1147
|
+
icon: /* @__PURE__ */ React13.createElement(Icon, { fontSize: "small", color: "action" })
|
|
1113
1148
|
}
|
|
1114
|
-
), /* @__PURE__ */
|
|
1149
|
+
), /* @__PURE__ */ React13.createElement(import_ui12.Box, { sx: { p: 1 } }, /* @__PURE__ */ React13.createElement(
|
|
1115
1150
|
StatusSection,
|
|
1116
1151
|
{
|
|
1117
1152
|
label: (0, import_i18n13.__)("Failed audits", "elementor"),
|
|
@@ -1119,13 +1154,13 @@ function CategoryPage({ category, report, onBack }) {
|
|
|
1119
1154
|
color: "error",
|
|
1120
1155
|
defaultExpanded: true
|
|
1121
1156
|
},
|
|
1122
|
-
failed.map((r) => /* @__PURE__ */
|
|
1123
|
-
), /* @__PURE__ */
|
|
1157
|
+
failed.map((r) => /* @__PURE__ */ React13.createElement(ViolationRow, { key: r.audit.id, audit: r.audit, violations: r.result.violations }))
|
|
1158
|
+
), /* @__PURE__ */ React13.createElement(StatusSection, { label: (0, import_i18n13.__)("Passed audits", "elementor"), count: passed.length, color: "success" }, passed.map((r) => /* @__PURE__ */ React13.createElement(ViolationRow, { key: r.audit.id, audit: r.audit })))));
|
|
1124
1159
|
}
|
|
1125
1160
|
|
|
1126
1161
|
// src/components/pages/issues-page.tsx
|
|
1127
|
-
var
|
|
1128
|
-
var
|
|
1162
|
+
var React17 = __toESM(require("react"));
|
|
1163
|
+
var import_ui16 = require("@elementor/ui");
|
|
1129
1164
|
var import_i18n17 = require("@wordpress/i18n");
|
|
1130
1165
|
|
|
1131
1166
|
// src/utils/severity-counts.ts
|
|
@@ -1133,14 +1168,17 @@ var import_i18n14 = require("@wordpress/i18n");
|
|
|
1133
1168
|
var ALL_SEVERITIES = ["error", "warning", "info"];
|
|
1134
1169
|
function countSeverities(report, category) {
|
|
1135
1170
|
const counts = { error: 0, warning: 0, info: 0 };
|
|
1136
|
-
for (const { audit:
|
|
1171
|
+
for (const { audit: audit22, result } of report.auditResults) {
|
|
1137
1172
|
if (result.status !== "fail") {
|
|
1138
1173
|
continue;
|
|
1139
1174
|
}
|
|
1140
|
-
if (category && !
|
|
1175
|
+
if (category && !audit22.categories.includes(category)) {
|
|
1176
|
+
continue;
|
|
1177
|
+
}
|
|
1178
|
+
if (!isScoredAudit(audit22)) {
|
|
1141
1179
|
continue;
|
|
1142
1180
|
}
|
|
1143
|
-
counts[
|
|
1181
|
+
counts[audit22.severity] += result.violations.length;
|
|
1144
1182
|
}
|
|
1145
1183
|
return counts;
|
|
1146
1184
|
}
|
|
@@ -1178,14 +1216,14 @@ function severityRemainingCountLabel(severity, count) {
|
|
|
1178
1216
|
}
|
|
1179
1217
|
|
|
1180
1218
|
// src/components/issues-category-row.tsx
|
|
1181
|
-
var
|
|
1219
|
+
var React14 = __toESM(require("react"));
|
|
1182
1220
|
var import_icons9 = require("@elementor/icons");
|
|
1183
|
-
var
|
|
1221
|
+
var import_ui13 = require("@elementor/ui");
|
|
1184
1222
|
function IssuesCategoryRow({ category, label, counts, onClick }) {
|
|
1185
|
-
const isRtl = "rtl" === (0,
|
|
1223
|
+
const isRtl = "rtl" === (0, import_ui13.useTheme)().direction;
|
|
1186
1224
|
const Icon = CATEGORY_ICONS[category];
|
|
1187
|
-
return /* @__PURE__ */
|
|
1188
|
-
|
|
1225
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1226
|
+
import_ui13.Box,
|
|
1189
1227
|
{
|
|
1190
1228
|
role: "button",
|
|
1191
1229
|
tabIndex: 0,
|
|
@@ -1206,16 +1244,16 @@ function IssuesCategoryRow({ category, label, counts, onClick }) {
|
|
|
1206
1244
|
"&:focus-visible": { outline: "2px solid", outlineColor: "primary.main" }
|
|
1207
1245
|
}
|
|
1208
1246
|
},
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ React14.createElement(Icon, { fontSize: "small", color: "action" }),
|
|
1248
|
+
/* @__PURE__ */ React14.createElement(import_ui13.Typography, { variant: "body2", fontWeight: "bold", sx: { flex: 1 } }, label),
|
|
1249
|
+
/* @__PURE__ */ React14.createElement(import_ui13.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, ALL_SEVERITIES.filter((s) => counts[s] > 0).map((severity) => /* @__PURE__ */ React14.createElement(import_ui13.Box, { key: severity, sx: { display: "flex", alignItems: "center", gap: 0.25 } }, /* @__PURE__ */ React14.createElement(SeverityIcon, { severity }), /* @__PURE__ */ React14.createElement(import_ui13.Typography, { variant: "caption", color: "text.primary", fontWeight: "bold" }, counts[severity])))),
|
|
1250
|
+
/* @__PURE__ */ React14.createElement(import_ui13.Rotate, { in: isRtl }, /* @__PURE__ */ React14.createElement(import_icons9.ChevronRightIcon, { fontSize: "small", color: "action" }))
|
|
1213
1251
|
);
|
|
1214
1252
|
}
|
|
1215
1253
|
|
|
1216
1254
|
// src/components/promotions.tsx
|
|
1217
|
-
var
|
|
1218
|
-
var
|
|
1255
|
+
var React16 = __toESM(require("react"));
|
|
1256
|
+
var import_ui15 = require("@elementor/ui");
|
|
1219
1257
|
var import_i18n16 = require("@wordpress/i18n");
|
|
1220
1258
|
|
|
1221
1259
|
// src/register-promotions.ts
|
|
@@ -1252,6 +1290,13 @@ var PROMOTIONS = [
|
|
|
1252
1290
|
formatSubtitle: (run) => run.result.status === "fail" ? (0, import_i18n15.__)("Generate cookie policy", "elementor") : null,
|
|
1253
1291
|
getCtaUrl: firstFailExternalUrl
|
|
1254
1292
|
},
|
|
1293
|
+
{
|
|
1294
|
+
auditId: "audits/scan-for-cookies",
|
|
1295
|
+
icon: import_icons10.ElementorCookieIcon,
|
|
1296
|
+
ctaLabel: (0, import_i18n15.__)("Scan", "elementor"),
|
|
1297
|
+
formatSubtitle: (run) => run.result.status === "fail" ? (0, import_i18n15.__)("Scan this page for cookies", "elementor") : null,
|
|
1298
|
+
getCtaUrl: firstFailExternalUrl
|
|
1299
|
+
},
|
|
1255
1300
|
{
|
|
1256
1301
|
auditId: "audits/images-too-large",
|
|
1257
1302
|
icon: import_icons10.ShieldHalfFilledIcon,
|
|
@@ -1280,11 +1325,11 @@ function findAuditRun(report, auditId) {
|
|
|
1280
1325
|
}
|
|
1281
1326
|
|
|
1282
1327
|
// src/components/promotion-card.tsx
|
|
1283
|
-
var
|
|
1284
|
-
var
|
|
1328
|
+
var React15 = __toESM(require("react"));
|
|
1329
|
+
var import_ui14 = require("@elementor/ui");
|
|
1285
1330
|
function PromotionCard({ ctaDisabled, ctaLabel, icon: Icon, onCtaClick, subtitle, title }) {
|
|
1286
|
-
return /* @__PURE__ */
|
|
1287
|
-
|
|
1331
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1332
|
+
import_ui14.Box,
|
|
1288
1333
|
{
|
|
1289
1334
|
sx: {
|
|
1290
1335
|
alignItems: "center",
|
|
@@ -1297,9 +1342,9 @@ function PromotionCard({ ctaDisabled, ctaLabel, icon: Icon, onCtaClick, subtitle
|
|
|
1297
1342
|
py: 1.5
|
|
1298
1343
|
}
|
|
1299
1344
|
},
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
/* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ React15.createElement(Icon, { fontSize: "small", color: "action" }),
|
|
1346
|
+
/* @__PURE__ */ React15.createElement(import_ui14.Box, { sx: { display: "flex", flex: 1, flexDirection: "column", gap: 0.25, minWidth: 0 } }, /* @__PURE__ */ React15.createElement(import_ui14.Typography, { variant: "body2", fontWeight: "bold" }, title), /* @__PURE__ */ React15.createElement(import_ui14.Typography, { variant: "caption", color: "text.secondary" }, subtitle)),
|
|
1347
|
+
/* @__PURE__ */ React15.createElement(import_ui14.Button, { variant: "outlined", color: "secondary", size: "small", disabled: ctaDisabled, onClick: onCtaClick }, ctaLabel)
|
|
1303
1348
|
);
|
|
1304
1349
|
}
|
|
1305
1350
|
|
|
@@ -1328,7 +1373,7 @@ function Promotions({ report }) {
|
|
|
1328
1373
|
if (cards.length === 0) {
|
|
1329
1374
|
return null;
|
|
1330
1375
|
}
|
|
1331
|
-
return /* @__PURE__ */
|
|
1376
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(import_ui15.Typography, { variant: "subtitle1", fontWeight: "bold" }, (0, import_i18n16.__)("Quick wins", "elementor")), /* @__PURE__ */ React16.createElement(import_ui15.Box, { sx: { display: "flex", flexDirection: "column", gap: 1 } }, cards.map(({ config, ctaUrl, key, run, subtitle }) => /* @__PURE__ */ React16.createElement(
|
|
1332
1377
|
PromotionCard,
|
|
1333
1378
|
{
|
|
1334
1379
|
key,
|
|
@@ -1349,8 +1394,8 @@ function Promotions({ report }) {
|
|
|
1349
1394
|
// src/components/pages/issues-page.tsx
|
|
1350
1395
|
function IssuesPage({ report, onCategoryClick, onAllAuditsClick }) {
|
|
1351
1396
|
const populatedCategories = getPopulatedCategories(report.categories, ALL_CATEGORIES);
|
|
1352
|
-
return /* @__PURE__ */
|
|
1353
|
-
|
|
1397
|
+
return /* @__PURE__ */ React17.createElement(import_ui16.Box, { sx: { display: "flex", flexDirection: "column", gap: 4, p: 2 } }, /* @__PURE__ */ React17.createElement(
|
|
1398
|
+
import_ui16.Link,
|
|
1354
1399
|
{
|
|
1355
1400
|
component: "button",
|
|
1356
1401
|
underline: "none",
|
|
@@ -1358,8 +1403,8 @@ function IssuesPage({ report, onCategoryClick, onAllAuditsClick }) {
|
|
|
1358
1403
|
onClick: onAllAuditsClick,
|
|
1359
1404
|
sx: { textAlign: "start" }
|
|
1360
1405
|
},
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
), /* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ React17.createElement(import_ui16.Typography, { variant: "subtitle1", component: "h2" }, (0, import_i18n17.__)("All issues", "elementor"))
|
|
1407
|
+
), /* @__PURE__ */ React17.createElement(import_ui16.Box, { sx: { display: "flex", flexDirection: "column", gap: 1 } }, populatedCategories.map((category) => /* @__PURE__ */ React17.createElement(
|
|
1363
1408
|
IssuesCategoryRow,
|
|
1364
1409
|
{
|
|
1365
1410
|
key: category,
|
|
@@ -1368,12 +1413,12 @@ function IssuesPage({ report, onCategoryClick, onAllAuditsClick }) {
|
|
|
1368
1413
|
counts: countSeverities(report, category),
|
|
1369
1414
|
onClick: () => onCategoryClick(category)
|
|
1370
1415
|
}
|
|
1371
|
-
))), /* @__PURE__ */
|
|
1416
|
+
))), /* @__PURE__ */ React17.createElement(Promotions, { report }));
|
|
1372
1417
|
}
|
|
1373
1418
|
|
|
1374
1419
|
// src/components/pages/overview-page.tsx
|
|
1375
|
-
var
|
|
1376
|
-
var
|
|
1420
|
+
var React21 = __toESM(require("react"));
|
|
1421
|
+
var import_ui20 = require("@elementor/ui");
|
|
1377
1422
|
var import_i18n19 = require("@wordpress/i18n");
|
|
1378
1423
|
|
|
1379
1424
|
// src/utils/score-thresholds.ts
|
|
@@ -1391,8 +1436,8 @@ function getScoreTier(score) {
|
|
|
1391
1436
|
}
|
|
1392
1437
|
|
|
1393
1438
|
// src/components/count-summary-circle.tsx
|
|
1394
|
-
var
|
|
1395
|
-
var
|
|
1439
|
+
var React18 = __toESM(require("react"));
|
|
1440
|
+
var import_ui17 = require("@elementor/ui");
|
|
1396
1441
|
var COUNT_SUMMARY_CIRCLE_SIZE = 64;
|
|
1397
1442
|
var COUNT_SUMMARY_BORDER_WIDTH = 4;
|
|
1398
1443
|
function chipBorderColor(theme, color) {
|
|
@@ -1402,8 +1447,8 @@ function chipBorderColor(theme, color) {
|
|
|
1402
1447
|
return theme.palette[color].main;
|
|
1403
1448
|
}
|
|
1404
1449
|
function CountSummaryCircle({ ariaLabel, color, count, label, onClick }) {
|
|
1405
|
-
return /* @__PURE__ */
|
|
1406
|
-
|
|
1450
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1451
|
+
import_ui17.Box,
|
|
1407
1452
|
{
|
|
1408
1453
|
"aria-label": ariaLabel,
|
|
1409
1454
|
component: "button",
|
|
@@ -1421,8 +1466,8 @@ function CountSummaryCircle({ ariaLabel, color, count, label, onClick }) {
|
|
|
1421
1466
|
padding: 0
|
|
1422
1467
|
}
|
|
1423
1468
|
},
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
|
|
1469
|
+
/* @__PURE__ */ React18.createElement(
|
|
1470
|
+
import_ui17.Chip,
|
|
1426
1471
|
{
|
|
1427
1472
|
color,
|
|
1428
1473
|
label: count,
|
|
@@ -1443,18 +1488,18 @@ function CountSummaryCircle({ ariaLabel, color, count, label, onClick }) {
|
|
|
1443
1488
|
})
|
|
1444
1489
|
}
|
|
1445
1490
|
),
|
|
1446
|
-
/* @__PURE__ */
|
|
1491
|
+
/* @__PURE__ */ React18.createElement(import_ui17.Typography, { color: "text.secondary", sx: { textAlign: "center" }, variant: "caption" }, label)
|
|
1447
1492
|
);
|
|
1448
1493
|
}
|
|
1449
1494
|
|
|
1450
1495
|
// src/components/score-bar.tsx
|
|
1451
|
-
var
|
|
1496
|
+
var React19 = __toESM(require("react"));
|
|
1452
1497
|
var import_icons11 = require("@elementor/icons");
|
|
1453
|
-
var
|
|
1498
|
+
var import_ui18 = require("@elementor/ui");
|
|
1454
1499
|
function ScoreBar({ label, score, onClick }) {
|
|
1455
|
-
const isRtl = "rtl" === (0,
|
|
1456
|
-
return /* @__PURE__ */
|
|
1457
|
-
|
|
1500
|
+
const isRtl = "rtl" === (0, import_ui18.useTheme)().direction;
|
|
1501
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1502
|
+
import_ui18.Box,
|
|
1458
1503
|
{
|
|
1459
1504
|
role: onClick ? "button" : void 0,
|
|
1460
1505
|
tabIndex: onClick ? 0 : void 0,
|
|
@@ -1470,9 +1515,9 @@ function ScoreBar({ label, score, onClick }) {
|
|
|
1470
1515
|
py: 0.5
|
|
1471
1516
|
}
|
|
1472
1517
|
},
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
/* @__PURE__ */
|
|
1475
|
-
|
|
1518
|
+
/* @__PURE__ */ React19.createElement(import_ui18.Typography, { variant: "body2", sx: { minWidth: 96 } }, label),
|
|
1519
|
+
/* @__PURE__ */ React19.createElement(
|
|
1520
|
+
import_ui18.LinearProgress,
|
|
1476
1521
|
{
|
|
1477
1522
|
variant: "determinate",
|
|
1478
1523
|
value: score,
|
|
@@ -1480,8 +1525,8 @@ function ScoreBar({ label, score, onClick }) {
|
|
|
1480
1525
|
sx: { flex: 1, height: 6, borderRadius: 4, bgcolor: "action.disabledBackground" }
|
|
1481
1526
|
}
|
|
1482
1527
|
),
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
|
|
1528
|
+
/* @__PURE__ */ React19.createElement(
|
|
1529
|
+
import_ui18.Typography,
|
|
1485
1530
|
{
|
|
1486
1531
|
variant: "body2",
|
|
1487
1532
|
color: "text.primary",
|
|
@@ -1489,19 +1534,19 @@ function ScoreBar({ label, score, onClick }) {
|
|
|
1489
1534
|
},
|
|
1490
1535
|
score
|
|
1491
1536
|
),
|
|
1492
|
-
onClick && /* @__PURE__ */
|
|
1537
|
+
onClick && /* @__PURE__ */ React19.createElement(import_ui18.Rotate, { in: isRtl }, /* @__PURE__ */ React19.createElement(import_icons11.ChevronRightIcon, { fontSize: "small", color: "action" }))
|
|
1493
1538
|
);
|
|
1494
1539
|
}
|
|
1495
1540
|
|
|
1496
1541
|
// src/components/score-circle.tsx
|
|
1497
|
-
var
|
|
1498
|
-
var
|
|
1542
|
+
var React20 = __toESM(require("react"));
|
|
1543
|
+
var import_ui19 = require("@elementor/ui");
|
|
1499
1544
|
var SCORE_CIRCLE_SIZE = 88;
|
|
1500
1545
|
var SCORE_CIRCLE_THICKNESS = 3;
|
|
1501
1546
|
function ScoreCircle({ color, score }) {
|
|
1502
1547
|
const progressColor = color ?? getScoreTier(score).color;
|
|
1503
|
-
return /* @__PURE__ */
|
|
1504
|
-
|
|
1548
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1549
|
+
import_ui19.Box,
|
|
1505
1550
|
{
|
|
1506
1551
|
role: "progressbar",
|
|
1507
1552
|
"aria-valuenow": score,
|
|
@@ -1509,8 +1554,8 @@ function ScoreCircle({ color, score }) {
|
|
|
1509
1554
|
"aria-valuemax": 100,
|
|
1510
1555
|
sx: { position: "relative", display: "inline-flex" }
|
|
1511
1556
|
},
|
|
1512
|
-
/* @__PURE__ */
|
|
1513
|
-
|
|
1557
|
+
/* @__PURE__ */ React20.createElement(
|
|
1558
|
+
import_ui19.CircularProgress,
|
|
1514
1559
|
{
|
|
1515
1560
|
variant: "determinate",
|
|
1516
1561
|
value: 100,
|
|
@@ -1519,8 +1564,8 @@ function ScoreCircle({ color, score }) {
|
|
|
1519
1564
|
sx: { color: "action.disabledBackground" }
|
|
1520
1565
|
}
|
|
1521
1566
|
),
|
|
1522
|
-
/* @__PURE__ */
|
|
1523
|
-
|
|
1567
|
+
/* @__PURE__ */ React20.createElement(
|
|
1568
|
+
import_ui19.CircularProgress,
|
|
1524
1569
|
{
|
|
1525
1570
|
variant: "determinate",
|
|
1526
1571
|
value: score,
|
|
@@ -1530,8 +1575,8 @@ function ScoreCircle({ color, score }) {
|
|
|
1530
1575
|
sx: { position: "absolute", left: 0 }
|
|
1531
1576
|
}
|
|
1532
1577
|
),
|
|
1533
|
-
/* @__PURE__ */
|
|
1534
|
-
|
|
1578
|
+
/* @__PURE__ */ React20.createElement(
|
|
1579
|
+
import_ui19.Box,
|
|
1535
1580
|
{
|
|
1536
1581
|
sx: {
|
|
1537
1582
|
position: "absolute",
|
|
@@ -1541,8 +1586,8 @@ function ScoreCircle({ color, score }) {
|
|
|
1541
1586
|
justifyContent: "center"
|
|
1542
1587
|
}
|
|
1543
1588
|
},
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
|
|
1589
|
+
/* @__PURE__ */ React20.createElement(
|
|
1590
|
+
import_ui19.Typography,
|
|
1546
1591
|
{
|
|
1547
1592
|
variant: "h4",
|
|
1548
1593
|
component: "span",
|
|
@@ -1579,8 +1624,8 @@ function OverviewPage({ onCategoryClick, onStatusClick, report }) {
|
|
|
1579
1624
|
const severityCounts = countSeverities(report);
|
|
1580
1625
|
const statusCounts = auditStatusDisplayCounts(report);
|
|
1581
1626
|
const overallScore = getScoreTier(report.overall);
|
|
1582
|
-
return /* @__PURE__ */
|
|
1583
|
-
|
|
1627
|
+
return /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { display: "flex", flexDirection: "column", gap: 4, p: 2 } }, /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { display: "flex", alignItems: "center", gap: 2 } }, /* @__PURE__ */ React21.createElement(ScoreCircle, { color: overallScore.color, score: report.overall }), /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { display: "flex", flexDirection: "column", gap: 0.5 } }, /* @__PURE__ */ React21.createElement(
|
|
1628
|
+
import_ui20.Chip,
|
|
1584
1629
|
{
|
|
1585
1630
|
label: overallScore.label,
|
|
1586
1631
|
color: overallScore.color,
|
|
@@ -1588,7 +1633,7 @@ function OverviewPage({ onCategoryClick, onStatusClick, report }) {
|
|
|
1588
1633
|
size: "small",
|
|
1589
1634
|
sx: { fontWeight: 600, alignSelf: "flex-start" }
|
|
1590
1635
|
}
|
|
1591
|
-
), /* @__PURE__ */
|
|
1636
|
+
), /* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "body2", color: "text.secondary" }, (0, import_i18n19.__)("Overall score", "elementor")))), /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { display: "flex", flexDirection: "column", gap: 2 } }, populatedCategories.map((category) => /* @__PURE__ */ React21.createElement(
|
|
1592
1637
|
ScoreBar,
|
|
1593
1638
|
{
|
|
1594
1639
|
key: category,
|
|
@@ -1596,7 +1641,7 @@ function OverviewPage({ onCategoryClick, onStatusClick, report }) {
|
|
|
1596
1641
|
score: report.categories[category].score,
|
|
1597
1642
|
onClick: () => onCategoryClick(category)
|
|
1598
1643
|
}
|
|
1599
|
-
))), /* @__PURE__ */
|
|
1644
|
+
))), /* @__PURE__ */ React21.createElement(import_ui20.Divider, null), /* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "subtitle1", fontWeight: "bold" }, (0, import_i18n19.__)("Audit statuses", "elementor")), /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { display: "flex", justifyContent: "space-around", gap: 2 } }, STATUS_GROUPS.map((status) => /* @__PURE__ */ React21.createElement(
|
|
1600
1645
|
CountSummaryCircle,
|
|
1601
1646
|
{
|
|
1602
1647
|
key: status,
|
|
@@ -1606,8 +1651,8 @@ function OverviewPage({ onCategoryClick, onStatusClick, report }) {
|
|
|
1606
1651
|
label: auditStatusLabel(status),
|
|
1607
1652
|
onClick: () => onStatusClick(status)
|
|
1608
1653
|
}
|
|
1609
|
-
))), /* @__PURE__ */
|
|
1610
|
-
|
|
1654
|
+
))), /* @__PURE__ */ React21.createElement(import_ui20.Divider, null), /* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "subtitle1", fontWeight: "bold" }, (0, import_i18n19.__)("Remaining issues", "elementor")), /* @__PURE__ */ React21.createElement(
|
|
1655
|
+
import_ui20.Box,
|
|
1611
1656
|
{
|
|
1612
1657
|
component: "ul",
|
|
1613
1658
|
sx: {
|
|
@@ -1621,17 +1666,17 @@ function OverviewPage({ onCategoryClick, onStatusClick, report }) {
|
|
|
1621
1666
|
},
|
|
1622
1667
|
ALL_SEVERITIES.map((severity) => {
|
|
1623
1668
|
const count = severityCounts[severity];
|
|
1624
|
-
return /* @__PURE__ */
|
|
1625
|
-
|
|
1669
|
+
return /* @__PURE__ */ React21.createElement(
|
|
1670
|
+
import_ui20.Box,
|
|
1626
1671
|
{
|
|
1627
1672
|
"aria-label": severityRemainingCountLabel(severity, count),
|
|
1628
1673
|
component: "li",
|
|
1629
1674
|
key: severity,
|
|
1630
1675
|
sx: { alignItems: "center", display: "flex", gap: 0.5 }
|
|
1631
1676
|
},
|
|
1632
|
-
/* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1634
|
-
/* @__PURE__ */
|
|
1677
|
+
/* @__PURE__ */ React21.createElement(SeverityIcon, { severity }),
|
|
1678
|
+
/* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "body2", fontWeight: "bold" }, count),
|
|
1679
|
+
/* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "body2" }, severityPluralLabel(severity))
|
|
1635
1680
|
);
|
|
1636
1681
|
})
|
|
1637
1682
|
));
|
|
@@ -1670,8 +1715,8 @@ function ReportShell({ report }) {
|
|
|
1670
1715
|
setActivePage(activePage.backTo);
|
|
1671
1716
|
}
|
|
1672
1717
|
};
|
|
1673
|
-
return /* @__PURE__ */
|
|
1674
|
-
|
|
1718
|
+
return /* @__PURE__ */ React22.createElement(import_ui21.Box, null, /* @__PURE__ */ React22.createElement(
|
|
1719
|
+
import_ui21.Tabs,
|
|
1675
1720
|
{
|
|
1676
1721
|
"aria-label": (0, import_i18n20.__)("Audit navigation", "elementor"),
|
|
1677
1722
|
value: currentTab,
|
|
@@ -1682,30 +1727,30 @@ function ReportShell({ report }) {
|
|
|
1682
1727
|
centered: true,
|
|
1683
1728
|
variant: "fullWidth"
|
|
1684
1729
|
},
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
/* @__PURE__ */
|
|
1687
|
-
), /* @__PURE__ */
|
|
1730
|
+
/* @__PURE__ */ React22.createElement(import_ui21.Tab, { value: "overview", label: (0, import_i18n20.__)("Overview", "elementor") }),
|
|
1731
|
+
/* @__PURE__ */ React22.createElement(import_ui21.Tab, { value: "issues", label: (0, import_i18n20.__)("Issues", "elementor") })
|
|
1732
|
+
), /* @__PURE__ */ React22.createElement(import_ui21.Divider, null), activePage === "overview" && /* @__PURE__ */ React22.createElement(
|
|
1688
1733
|
OverviewPage,
|
|
1689
1734
|
{
|
|
1690
1735
|
report,
|
|
1691
1736
|
onCategoryClick: (category) => openCategory(category, "overview"),
|
|
1692
1737
|
onStatusClick: (status) => openAllAudits(status, "overview")
|
|
1693
1738
|
}
|
|
1694
|
-
), activePage === "issues" && /* @__PURE__ */
|
|
1739
|
+
), activePage === "issues" && /* @__PURE__ */ React22.createElement(
|
|
1695
1740
|
IssuesPage,
|
|
1696
1741
|
{
|
|
1697
1742
|
report,
|
|
1698
1743
|
onCategoryClick: (category) => openCategory(category, "issues"),
|
|
1699
1744
|
onAllAuditsClick: () => openAllAudits()
|
|
1700
1745
|
}
|
|
1701
|
-
), isAllAuditsPage(activePage) && /* @__PURE__ */
|
|
1746
|
+
), isAllAuditsPage(activePage) && /* @__PURE__ */ React22.createElement(
|
|
1702
1747
|
AllAuditsPage,
|
|
1703
1748
|
{
|
|
1704
1749
|
report,
|
|
1705
1750
|
initialExpandedStatus: activePage.expand,
|
|
1706
1751
|
onBack: backFromSubPage
|
|
1707
1752
|
}
|
|
1708
|
-
), isCategoryPage(activePage) && /* @__PURE__ */
|
|
1753
|
+
), isCategoryPage(activePage) && /* @__PURE__ */ React22.createElement(CategoryPage, { category: activePage.category, report, onBack: backFromSubPage }));
|
|
1709
1754
|
}
|
|
1710
1755
|
|
|
1711
1756
|
// src/components/audit-panel.tsx
|
|
@@ -1714,7 +1759,7 @@ function AuditPanel() {
|
|
|
1714
1759
|
const currentDocumentId = (0, import_editor_elements5.getCurrentDocumentId)() ?? 0;
|
|
1715
1760
|
const onRun = () => run(currentDocumentId);
|
|
1716
1761
|
const lastScanLabel = report ? new Date(report.runAt).toLocaleTimeString() : null;
|
|
1717
|
-
return /* @__PURE__ */
|
|
1762
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
1718
1763
|
import_editor_floating_panels.FloatingPanelHeader,
|
|
1719
1764
|
{
|
|
1720
1765
|
panelId: "audit-panel",
|
|
@@ -1722,8 +1767,8 @@ function AuditPanel() {
|
|
|
1722
1767
|
badge: (0, import_i18n21.__)("Beta", "elementor"),
|
|
1723
1768
|
titleVariant: "subtitle2"
|
|
1724
1769
|
}
|
|
1725
|
-
), /* @__PURE__ */
|
|
1726
|
-
|
|
1770
|
+
), /* @__PURE__ */ React23.createElement(import_editor_floating_panels.FloatingPanelBody, null, status === "idle" && /* @__PURE__ */ React23.createElement(WelcomePage, null), status === "loading" && /* @__PURE__ */ React23.createElement(LoadingPage, null), status === "error" && /* @__PURE__ */ React23.createElement(ErrorPage, { message: error ?? "", onRetry: onRun }), status === "ready" && report && /* @__PURE__ */ React23.createElement(ReportShell, { report })), /* @__PURE__ */ React23.createElement(import_editor_floating_panels.FloatingPanelFooter, null, lastScanLabel ? /* @__PURE__ */ React23.createElement(import_ui22.Typography, { variant: "caption", sx: { flex: 1 } }, (0, import_i18n21.__)("Last scan:", "elementor"), " ", lastScanLabel) : /* @__PURE__ */ React23.createElement(import_ui22.Box, { sx: { flex: 1 } }), lastScanLabel && /* @__PURE__ */ React23.createElement(AuditFeedback, null), /* @__PURE__ */ React23.createElement(
|
|
1771
|
+
import_ui22.Button,
|
|
1727
1772
|
{
|
|
1728
1773
|
variant: "contained",
|
|
1729
1774
|
size: "small",
|
|
@@ -2670,7 +2715,8 @@ var audit16 = {
|
|
|
2670
2715
|
{
|
|
2671
2716
|
auditId: audit16.id,
|
|
2672
2717
|
label: (0, import_i18n38.__)("No privacy policy page is set.", "elementor"),
|
|
2673
|
-
externalUrl: ctx.pageContext.privacy_settings_url
|
|
2718
|
+
externalUrl: ctx.pageContext.privacy_settings_url,
|
|
2719
|
+
ctaLabel: (0, import_i18n38.__)("Create", "elementor")
|
|
2674
2720
|
}
|
|
2675
2721
|
]
|
|
2676
2722
|
};
|
|
@@ -2710,30 +2756,58 @@ var audit17 = {
|
|
|
2710
2756
|
}
|
|
2711
2757
|
};
|
|
2712
2758
|
|
|
2713
|
-
// src/audits/
|
|
2759
|
+
// src/audits/scan-for-cookies.ts
|
|
2714
2760
|
var import_i18n40 = require("@wordpress/i18n");
|
|
2715
2761
|
var audit18 = {
|
|
2716
|
-
id: "audits/
|
|
2717
|
-
title: (0, import_i18n40.__)("
|
|
2762
|
+
id: "audits/scan-for-cookies",
|
|
2763
|
+
title: (0, import_i18n40.__)("Scan for cookies", "elementor"),
|
|
2718
2764
|
description: (0, import_i18n40.__)(
|
|
2765
|
+
"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
|
+
"elementor"
|
|
2767
|
+
),
|
|
2768
|
+
fixHint: (0, import_i18n40.__)("Run a Cookiez scan on this page to see which cookies need disclosure.", "elementor"),
|
|
2769
|
+
categories: ["compliance"],
|
|
2770
|
+
severity: "info",
|
|
2771
|
+
weight: 0,
|
|
2772
|
+
evaluate: (ctx) => {
|
|
2773
|
+
const isReady = ctx.pageContext.cookiez_plugin_installed && ctx.pageContext.cookiez_plugin_active;
|
|
2774
|
+
return {
|
|
2775
|
+
status: "fail",
|
|
2776
|
+
violations: [
|
|
2777
|
+
{
|
|
2778
|
+
auditId: audit18.id,
|
|
2779
|
+
label: (0, import_i18n40.__)("This page has not been scanned for cookies yet.", "elementor"),
|
|
2780
|
+
externalUrl: isReady ? ctx.pageContext.cookiez_scan_url : ctx.pageContext.cookiez_plugin_action_url
|
|
2781
|
+
}
|
|
2782
|
+
]
|
|
2783
|
+
};
|
|
2784
|
+
}
|
|
2785
|
+
};
|
|
2786
|
+
|
|
2787
|
+
// src/audits/sections-and-columns.ts
|
|
2788
|
+
var import_i18n41 = require("@wordpress/i18n");
|
|
2789
|
+
var audit19 = {
|
|
2790
|
+
id: "audits/sections-and-columns",
|
|
2791
|
+
title: (0, import_i18n41.__)("Sections and columns", "elementor"),
|
|
2792
|
+
description: (0, import_i18n41.__)(
|
|
2719
2793
|
"Sections and columns are legacy elements. Containers render fewer DOM nodes and are more flexible.",
|
|
2720
2794
|
"elementor"
|
|
2721
2795
|
),
|
|
2722
|
-
fixHint: (0,
|
|
2796
|
+
fixHint: (0, import_i18n41.__)("Use the Container Converter to replace each section/column with a container.", "elementor"),
|
|
2723
2797
|
categories: ["best-practices", "performance"],
|
|
2724
2798
|
severity: "warning",
|
|
2725
2799
|
weight: 7,
|
|
2726
2800
|
evaluate: (ctx) => {
|
|
2727
2801
|
if (ctx.elements.tree.length === 0) {
|
|
2728
|
-
return { status: "skipped", reason: (0,
|
|
2802
|
+
return { status: "skipped", reason: (0, import_i18n41.__)("No elements", "elementor") };
|
|
2729
2803
|
}
|
|
2730
2804
|
const violations = [];
|
|
2731
2805
|
walkElements(ctx.elements.tree, (node) => {
|
|
2732
2806
|
if (node.elType === "section" || node.elType === "column") {
|
|
2733
2807
|
violations.push({
|
|
2734
|
-
auditId:
|
|
2808
|
+
auditId: audit19.id,
|
|
2735
2809
|
elementId: node.id,
|
|
2736
|
-
label: node.elType === "section" ? (0,
|
|
2810
|
+
label: node.elType === "section" ? (0, import_i18n41.__)("Section element", "elementor") : (0, import_i18n41.__)("Column element", "elementor")
|
|
2737
2811
|
});
|
|
2738
2812
|
}
|
|
2739
2813
|
});
|
|
@@ -2742,15 +2816,15 @@ var audit18 = {
|
|
|
2742
2816
|
};
|
|
2743
2817
|
|
|
2744
2818
|
// src/audits/site-identity.ts
|
|
2745
|
-
var
|
|
2746
|
-
var
|
|
2819
|
+
var import_i18n42 = require("@wordpress/i18n");
|
|
2820
|
+
var audit20 = {
|
|
2747
2821
|
id: "audits/site-identity",
|
|
2748
|
-
title: (0,
|
|
2749
|
-
description: (0,
|
|
2822
|
+
title: (0, import_i18n42.__)("Site identity", "elementor"),
|
|
2823
|
+
description: (0, import_i18n42.__)(
|
|
2750
2824
|
"Site name, description, logo, and favicon establish your brand and appear in search results and browser tabs.",
|
|
2751
2825
|
"elementor"
|
|
2752
2826
|
),
|
|
2753
|
-
fixHint: (0,
|
|
2827
|
+
fixHint: (0, import_i18n42.__)("Open Site Settings \u2192 Site Identity and complete all the missing fields.", "elementor"),
|
|
2754
2828
|
categories: ["best-practices", "seo"],
|
|
2755
2829
|
severity: "info",
|
|
2756
2830
|
weight: 7,
|
|
@@ -2759,30 +2833,30 @@ var audit19 = {
|
|
|
2759
2833
|
const violations = [];
|
|
2760
2834
|
if (!identity.site_name_set) {
|
|
2761
2835
|
violations.push({
|
|
2762
|
-
auditId:
|
|
2763
|
-
label: (0,
|
|
2836
|
+
auditId: audit20.id,
|
|
2837
|
+
label: (0, import_i18n42.__)("Site name is missing or still uses the default.", "elementor"),
|
|
2764
2838
|
targetHint: "site-identity-settings"
|
|
2765
2839
|
});
|
|
2766
2840
|
}
|
|
2767
2841
|
if (!identity.site_description_set) {
|
|
2768
2842
|
violations.push({
|
|
2769
|
-
auditId:
|
|
2770
|
-
label: (0,
|
|
2843
|
+
auditId: audit20.id,
|
|
2844
|
+
label: (0, import_i18n42.__)("Site description is missing or still uses the default.", "elementor"),
|
|
2771
2845
|
targetHint: "site-identity-settings",
|
|
2772
2846
|
angieFix: true
|
|
2773
2847
|
});
|
|
2774
2848
|
}
|
|
2775
2849
|
if (!identity.site_logo_set) {
|
|
2776
2850
|
violations.push({
|
|
2777
|
-
auditId:
|
|
2778
|
-
label: (0,
|
|
2851
|
+
auditId: audit20.id,
|
|
2852
|
+
label: (0, import_i18n42.__)("Site logo is not set.", "elementor"),
|
|
2779
2853
|
targetHint: "site-identity-settings"
|
|
2780
2854
|
});
|
|
2781
2855
|
}
|
|
2782
2856
|
if (!identity.site_favicon_set) {
|
|
2783
2857
|
violations.push({
|
|
2784
|
-
auditId:
|
|
2785
|
-
label: (0,
|
|
2858
|
+
auditId: audit20.id,
|
|
2859
|
+
label: (0, import_i18n42.__)("Site favicon is not set.", "elementor"),
|
|
2786
2860
|
targetHint: "site-identity-settings"
|
|
2787
2861
|
});
|
|
2788
2862
|
}
|
|
@@ -2797,19 +2871,19 @@ var audit19 = {
|
|
|
2797
2871
|
};
|
|
2798
2872
|
|
|
2799
2873
|
// src/audits/too-many-widgets.ts
|
|
2800
|
-
var
|
|
2874
|
+
var import_i18n43 = require("@wordpress/i18n");
|
|
2801
2875
|
var WIDGET_COUNT_THRESHOLD = 100;
|
|
2802
|
-
var
|
|
2876
|
+
var audit21 = {
|
|
2803
2877
|
id: "audits/too-many-widgets",
|
|
2804
|
-
title: (0,
|
|
2805
|
-
description: (0,
|
|
2806
|
-
fixHint: (0,
|
|
2878
|
+
title: (0, import_i18n43.__)("Too many widgets", "elementor"),
|
|
2879
|
+
description: (0, import_i18n43.__)("Excessive DOM size caused by too many widgets degrades rendering performance.", "elementor"),
|
|
2880
|
+
fixHint: (0, import_i18n43.__)("Reduce the number of widgets on the page by removing or combining elements.", "elementor"),
|
|
2807
2881
|
categories: ["best-practices", "performance"],
|
|
2808
2882
|
severity: "warning",
|
|
2809
2883
|
weight: 5,
|
|
2810
2884
|
evaluate: (ctx) => {
|
|
2811
2885
|
if (ctx.elements.tree.length === 0) {
|
|
2812
|
-
return { status: "skipped", reason: (0,
|
|
2886
|
+
return { status: "skipped", reason: (0, import_i18n43.__)("No elements", "elementor") };
|
|
2813
2887
|
}
|
|
2814
2888
|
let widgetCount = 0;
|
|
2815
2889
|
walkElements(ctx.elements.tree, (node) => {
|
|
@@ -2824,8 +2898,8 @@ var audit20 = {
|
|
|
2824
2898
|
status: "fail",
|
|
2825
2899
|
violations: [
|
|
2826
2900
|
{
|
|
2827
|
-
auditId:
|
|
2828
|
-
label: (0,
|
|
2901
|
+
auditId: audit21.id,
|
|
2902
|
+
label: (0, import_i18n43.__)("Page has too many widgets.", "elementor")
|
|
2829
2903
|
}
|
|
2830
2904
|
]
|
|
2831
2905
|
};
|
|
@@ -2839,12 +2913,12 @@ var AUDITS = [
|
|
|
2839
2913
|
audit12,
|
|
2840
2914
|
audit7,
|
|
2841
2915
|
audit5,
|
|
2842
|
-
|
|
2843
|
-
|
|
2916
|
+
audit21,
|
|
2917
|
+
audit19,
|
|
2844
2918
|
audit3,
|
|
2845
2919
|
audit10,
|
|
2846
2920
|
audit4,
|
|
2847
|
-
|
|
2921
|
+
audit20,
|
|
2848
2922
|
audit14,
|
|
2849
2923
|
audit15,
|
|
2850
2924
|
audit6,
|
|
@@ -2853,11 +2927,12 @@ var AUDITS = [
|
|
|
2853
2927
|
audit17,
|
|
2854
2928
|
audit16,
|
|
2855
2929
|
audit,
|
|
2856
|
-
audit2
|
|
2930
|
+
audit2,
|
|
2931
|
+
audit18
|
|
2857
2932
|
];
|
|
2858
2933
|
function registerAllAudits() {
|
|
2859
|
-
for (const
|
|
2860
|
-
registerAudit(
|
|
2934
|
+
for (const audit22 of AUDITS) {
|
|
2935
|
+
registerAudit(audit22);
|
|
2861
2936
|
}
|
|
2862
2937
|
}
|
|
2863
2938
|
|