@elementor/editor-audits 4.4.0-1118 → 4.4.0-1119
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.js +475 -403
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +406 -334
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/audit-panel.tsx +8 -11
- package/src/components/audit-toggle-icon.tsx +22 -0
- package/src/components/rescan-button.tsx +38 -0
- package/src/hooks/use-audit-report.ts +3 -2
- package/src/hooks/use-audit-toggle-props.ts +2 -2
- package/src/init.ts +2 -0
- package/src/store/selectors.ts +4 -0
- package/src/store/slice.ts +10 -1
- package/src/sync-report-staleness.ts +14 -0
package/dist/index.js
CHANGED
|
@@ -37,26 +37,103 @@ __export(index_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(index_exports);
|
|
38
38
|
|
|
39
39
|
// src/init.ts
|
|
40
|
-
var
|
|
41
|
-
var
|
|
40
|
+
var import_editor_floating_panels6 = require("@elementor/editor-floating-panels");
|
|
41
|
+
var import_store7 = require("@elementor/store");
|
|
42
42
|
|
|
43
43
|
// src/editor-app-bar.tsx
|
|
44
44
|
var import_editor_app_bar = require("@elementor/editor-app-bar");
|
|
45
45
|
|
|
46
46
|
// src/hooks/use-audit-toggle-props.ts
|
|
47
|
-
var
|
|
48
|
-
|
|
47
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
48
|
+
|
|
49
|
+
// src/components/audit-toggle-icon.tsx
|
|
50
|
+
var React = __toESM(require("react"));
|
|
51
|
+
var import_icons = require("@elementor/icons");
|
|
52
|
+
var import_store2 = require("@elementor/store");
|
|
53
|
+
var import_ui = require("@elementor/ui");
|
|
54
|
+
|
|
55
|
+
// src/store/slice.ts
|
|
56
|
+
var import_store = require("@elementor/store");
|
|
57
|
+
var initialState = { status: "idle", report: null, error: null, isStale: false };
|
|
58
|
+
var slice = (0, import_store.__createSlice)({
|
|
59
|
+
name: "audits",
|
|
60
|
+
initialState,
|
|
61
|
+
reducers: {
|
|
62
|
+
runStarted(state) {
|
|
63
|
+
state.status = "loading";
|
|
64
|
+
state.error = null;
|
|
65
|
+
},
|
|
66
|
+
runSucceeded(state, action) {
|
|
67
|
+
state.status = "ready";
|
|
68
|
+
state.report = action.payload;
|
|
69
|
+
state.isStale = false;
|
|
70
|
+
},
|
|
71
|
+
runFailed(state, action) {
|
|
72
|
+
state.status = "error";
|
|
73
|
+
state.error = action.payload;
|
|
74
|
+
},
|
|
75
|
+
runAborted(state) {
|
|
76
|
+
state.status = state.report ? "ready" : "idle";
|
|
77
|
+
},
|
|
78
|
+
reportRestored(state, action) {
|
|
79
|
+
state.status = "ready";
|
|
80
|
+
state.report = action.payload;
|
|
81
|
+
state.error = null;
|
|
82
|
+
state.isStale = false;
|
|
83
|
+
},
|
|
84
|
+
reportCleared(state) {
|
|
85
|
+
state.status = "idle";
|
|
86
|
+
state.report = null;
|
|
87
|
+
state.error = null;
|
|
88
|
+
state.isStale = false;
|
|
89
|
+
},
|
|
90
|
+
reportStale(state) {
|
|
91
|
+
if (state.report) {
|
|
92
|
+
state.isStale = true;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// src/store/selectors.ts
|
|
99
|
+
function selectStatus(state) {
|
|
100
|
+
return state.audits.status;
|
|
101
|
+
}
|
|
102
|
+
function selectReport(state) {
|
|
103
|
+
return state.audits.report;
|
|
104
|
+
}
|
|
105
|
+
function selectError(state) {
|
|
106
|
+
return state.audits.error;
|
|
107
|
+
}
|
|
108
|
+
function selectIsStale(state) {
|
|
109
|
+
return state.audits.isStale;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/components/audit-toggle-icon.tsx
|
|
113
|
+
function AuditToggleIcon() {
|
|
114
|
+
const isStale = (0, import_store2.__useSelector)((state) => selectIsStale(state));
|
|
115
|
+
return /* @__PURE__ */ React.createElement(
|
|
116
|
+
import_ui.Badge,
|
|
117
|
+
{
|
|
118
|
+
variant: "dot",
|
|
119
|
+
color: "warning",
|
|
120
|
+
invisible: !isStale,
|
|
121
|
+
overlap: "circular",
|
|
122
|
+
slotProps: { badge: { "data-testid": "audit-stale-indicator" } }
|
|
123
|
+
},
|
|
124
|
+
/* @__PURE__ */ React.createElement(import_icons.ShieldCheckIcon, null)
|
|
125
|
+
);
|
|
126
|
+
}
|
|
49
127
|
|
|
50
128
|
// src/editor-panel.tsx
|
|
51
|
-
var
|
|
129
|
+
var import_editor_floating_panels5 = require("@elementor/editor-floating-panels");
|
|
52
130
|
|
|
53
131
|
// src/components/audit-panel.tsx
|
|
54
|
-
var
|
|
132
|
+
var React21 = __toESM(require("react"));
|
|
55
133
|
var import_editor_elements6 = require("@elementor/editor-elements");
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
var import_i18n16 = require("@wordpress/i18n");
|
|
134
|
+
var import_editor_floating_panels4 = require("@elementor/editor-floating-panels");
|
|
135
|
+
var import_ui20 = require("@elementor/ui");
|
|
136
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
60
137
|
|
|
61
138
|
// src/constants.ts
|
|
62
139
|
var import_i18n = require("@wordpress/i18n");
|
|
@@ -88,7 +165,7 @@ var CATEGORY_LABELS = {
|
|
|
88
165
|
// src/hooks/use-audit-report.ts
|
|
89
166
|
var import_react = require("react");
|
|
90
167
|
var import_editor_elements3 = require("@elementor/editor-elements");
|
|
91
|
-
var
|
|
168
|
+
var import_store4 = require("@elementor/store");
|
|
92
169
|
|
|
93
170
|
// src/runner.ts
|
|
94
171
|
var import_editor_elements2 = require("@elementor/editor-elements");
|
|
@@ -578,52 +655,6 @@ async function runPageAudit(documentId) {
|
|
|
578
655
|
return computeReport(documentId, auditResults);
|
|
579
656
|
}
|
|
580
657
|
|
|
581
|
-
// src/store/slice.ts
|
|
582
|
-
var import_store = require("@elementor/store");
|
|
583
|
-
var initialState = { status: "idle", report: null, error: null };
|
|
584
|
-
var slice = (0, import_store.__createSlice)({
|
|
585
|
-
name: "audits",
|
|
586
|
-
initialState,
|
|
587
|
-
reducers: {
|
|
588
|
-
runStarted(state) {
|
|
589
|
-
state.status = "loading";
|
|
590
|
-
state.error = null;
|
|
591
|
-
},
|
|
592
|
-
runSucceeded(state, action) {
|
|
593
|
-
state.status = "ready";
|
|
594
|
-
state.report = action.payload;
|
|
595
|
-
},
|
|
596
|
-
runFailed(state, action) {
|
|
597
|
-
state.status = "error";
|
|
598
|
-
state.error = action.payload;
|
|
599
|
-
},
|
|
600
|
-
runAborted(state) {
|
|
601
|
-
state.status = state.report ? "ready" : "idle";
|
|
602
|
-
},
|
|
603
|
-
reportRestored(state, action) {
|
|
604
|
-
state.status = "ready";
|
|
605
|
-
state.report = action.payload;
|
|
606
|
-
state.error = null;
|
|
607
|
-
},
|
|
608
|
-
reportCleared(state) {
|
|
609
|
-
state.status = "idle";
|
|
610
|
-
state.report = null;
|
|
611
|
-
state.error = null;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
});
|
|
615
|
-
|
|
616
|
-
// src/store/selectors.ts
|
|
617
|
-
function selectStatus(state) {
|
|
618
|
-
return state.audits.status;
|
|
619
|
-
}
|
|
620
|
-
function selectReport(state) {
|
|
621
|
-
return state.audits.report;
|
|
622
|
-
}
|
|
623
|
-
function selectError(state) {
|
|
624
|
-
return state.audits.error;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
658
|
// src/utils/report-storage.ts
|
|
628
659
|
var import_session = require("@elementor/session");
|
|
629
660
|
function getStorageKey(documentId) {
|
|
@@ -638,10 +669,11 @@ function persistReport(documentId, report) {
|
|
|
638
669
|
|
|
639
670
|
// src/hooks/use-audit-report.ts
|
|
640
671
|
function useAuditReport() {
|
|
641
|
-
const status = (0,
|
|
642
|
-
const report = (0,
|
|
643
|
-
const error = (0,
|
|
644
|
-
const
|
|
672
|
+
const status = (0, import_store4.__useSelector)((state) => selectStatus(state));
|
|
673
|
+
const report = (0, import_store4.__useSelector)((state) => selectReport(state));
|
|
674
|
+
const error = (0, import_store4.__useSelector)((state) => selectError(state));
|
|
675
|
+
const isStale = (0, import_store4.__useSelector)((state) => selectIsStale(state));
|
|
676
|
+
const dispatch2 = (0, import_store4.__useDispatch)();
|
|
645
677
|
const documentId = (0, import_editor_elements3.getHostDocumentId)() ?? 0;
|
|
646
678
|
(0, import_react.useEffect)(() => {
|
|
647
679
|
if (!documentId || report?.documentId === documentId) {
|
|
@@ -649,38 +681,38 @@ function useAuditReport() {
|
|
|
649
681
|
}
|
|
650
682
|
const persisted = getPersistedReport(documentId);
|
|
651
683
|
if (persisted) {
|
|
652
|
-
|
|
684
|
+
dispatch2(slice.actions.reportRestored(persisted));
|
|
653
685
|
} else if (report) {
|
|
654
|
-
|
|
686
|
+
dispatch2(slice.actions.reportCleared());
|
|
655
687
|
}
|
|
656
|
-
}, [documentId, report,
|
|
688
|
+
}, [documentId, report, dispatch2]);
|
|
657
689
|
const run = async (documentIdToRun) => {
|
|
658
|
-
|
|
690
|
+
dispatch2(slice.actions.runStarted());
|
|
659
691
|
try {
|
|
660
692
|
const nextReport = await runPageAudit(documentIdToRun);
|
|
661
|
-
|
|
693
|
+
dispatch2(slice.actions.runSucceeded(nextReport));
|
|
662
694
|
persistReport(documentIdToRun, nextReport);
|
|
663
695
|
} catch (e) {
|
|
664
696
|
if (e instanceof SessionExpiredError) {
|
|
665
|
-
|
|
697
|
+
dispatch2(slice.actions.runAborted());
|
|
666
698
|
return;
|
|
667
699
|
}
|
|
668
|
-
|
|
700
|
+
dispatch2(slice.actions.runFailed(e instanceof Error ? e.message : "Unknown error"));
|
|
669
701
|
}
|
|
670
702
|
};
|
|
671
|
-
return { status, report, error, run };
|
|
703
|
+
return { status, report, error, isStale, run };
|
|
672
704
|
}
|
|
673
705
|
|
|
674
706
|
// src/components/audit-feedback.tsx
|
|
675
|
-
var
|
|
707
|
+
var React2 = __toESM(require("react"));
|
|
676
708
|
var import_react2 = require("react");
|
|
677
709
|
var import_editor_floating_panels = require("@elementor/editor-floating-panels");
|
|
678
710
|
var import_editor_notifications = require("@elementor/editor-notifications");
|
|
679
711
|
var import_editor_v1_adapters = require("@elementor/editor-v1-adapters");
|
|
680
712
|
var import_events = require("@elementor/events");
|
|
681
713
|
var import_http_client2 = require("@elementor/http-client");
|
|
682
|
-
var
|
|
683
|
-
var
|
|
714
|
+
var import_icons2 = require("@elementor/icons");
|
|
715
|
+
var import_ui2 = require("@elementor/ui");
|
|
684
716
|
var import_i18n2 = require("@wordpress/i18n");
|
|
685
717
|
var FEEDBACK_SUBJECT = "Page Audit Tool";
|
|
686
718
|
var FEEDBACK_SUBJECT_LABEL = (0, import_i18n2.__)("Page Audit Tool", "elementor");
|
|
@@ -746,8 +778,8 @@ function AuditFeedback() {
|
|
|
746
778
|
trackEvent(FEEDBACK_SENT_EVENT, { entry_point: FEEDBACK_ENTRY_POINT });
|
|
747
779
|
}).catch(notifyError).finally(() => setIsSubmitting(false));
|
|
748
780
|
};
|
|
749
|
-
return /* @__PURE__ */
|
|
750
|
-
|
|
781
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(import_ui2.Tooltip, { title: triggerLabel, placement: "top", PopperProps: { sx: { zIndex: panelZIndex } } }, /* @__PURE__ */ React2.createElement(import_ui2.IconButton, { size: "small", "aria-label": triggerLabel, onClick: handleOpen }, /* @__PURE__ */ React2.createElement(import_icons2.MessageLinesIcon, { fontSize: "small" }))), /* @__PURE__ */ React2.createElement(
|
|
782
|
+
import_ui2.Dialog,
|
|
751
783
|
{
|
|
752
784
|
open: isOpen,
|
|
753
785
|
onClose: handleClose,
|
|
@@ -755,9 +787,9 @@ function AuditFeedback() {
|
|
|
755
787
|
"aria-describedby": DIALOG_DESCRIPTION_ID,
|
|
756
788
|
PaperProps: { sx: { borderRadius: 1 } }
|
|
757
789
|
},
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
/* @__PURE__ */
|
|
760
|
-
|
|
790
|
+
/* @__PURE__ */ React2.createElement(import_ui2.DialogHeader, { logo: false, onClose: handleClose }, /* @__PURE__ */ React2.createElement(import_ui2.DialogTitle, { id: DIALOG_TITLE_ID }, (0, import_i18n2.__)("Let us know what you think", "elementor"))),
|
|
791
|
+
/* @__PURE__ */ React2.createElement(import_ui2.DialogContent, { dividers: true }, /* @__PURE__ */ React2.createElement(import_ui2.Stack, { direction: "column", gap: 2 }, /* @__PURE__ */ React2.createElement(import_ui2.TextField, { value: FEEDBACK_SUBJECT_LABEL, disabled: true, fullWidth: true, size: "small" }), /* @__PURE__ */ React2.createElement(
|
|
792
|
+
import_ui2.TextField,
|
|
761
793
|
{
|
|
762
794
|
placeholder: (0, import_i18n2.__)(
|
|
763
795
|
"Tell us what you had in mind, what we can improve or fix to make this feature better.",
|
|
@@ -770,12 +802,12 @@ function AuditFeedback() {
|
|
|
770
802
|
onChange: (event) => setFeedbackText(event.target.value),
|
|
771
803
|
value: feedbackText
|
|
772
804
|
}
|
|
773
|
-
), /* @__PURE__ */
|
|
805
|
+
), /* @__PURE__ */ React2.createElement(import_ui2.Typography, { id: DIALOG_DESCRIPTION_ID, variant: "caption", color: "text.secondary" }, (0, import_i18n2.__)(
|
|
774
806
|
"We appreciate your feedback! While we review all submissions, we can't guarantee that every suggestion will result in a change or update.",
|
|
775
807
|
"elementor"
|
|
776
808
|
)))),
|
|
777
|
-
/* @__PURE__ */
|
|
778
|
-
|
|
809
|
+
/* @__PURE__ */ React2.createElement(import_ui2.DialogActions, null, /* @__PURE__ */ React2.createElement(import_ui2.Button, { variant: "text", color: "secondary", onClick: handleCancel }, (0, import_i18n2.__)("Cancel", "elementor")), /* @__PURE__ */ React2.createElement(
|
|
810
|
+
import_ui2.Button,
|
|
779
811
|
{
|
|
780
812
|
variant: "contained",
|
|
781
813
|
color: "primary",
|
|
@@ -788,30 +820,30 @@ function AuditFeedback() {
|
|
|
788
820
|
}
|
|
789
821
|
|
|
790
822
|
// src/components/pages/error-page.tsx
|
|
791
|
-
var
|
|
792
|
-
var
|
|
823
|
+
var React3 = __toESM(require("react"));
|
|
824
|
+
var import_ui3 = require("@elementor/ui");
|
|
793
825
|
var import_i18n3 = require("@wordpress/i18n");
|
|
794
826
|
function ErrorPage({ message, onRetry }) {
|
|
795
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ React3.createElement(import_ui3.Box, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: 1.5, p: 4 } }, /* @__PURE__ */ React3.createElement(import_ui3.Typography, { variant: "body2", color: "error", textAlign: "center" }, message), /* @__PURE__ */ React3.createElement(import_ui3.Button, { variant: "contained", size: "small", onClick: onRetry }, (0, import_i18n3.__)("Try again", "elementor")));
|
|
796
828
|
}
|
|
797
829
|
|
|
798
830
|
// src/components/pages/loading-page.tsx
|
|
799
|
-
var
|
|
800
|
-
var
|
|
831
|
+
var React4 = __toESM(require("react"));
|
|
832
|
+
var import_ui4 = require("@elementor/ui");
|
|
801
833
|
var import_i18n4 = require("@wordpress/i18n");
|
|
802
834
|
function LoadingPage() {
|
|
803
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ React4.createElement(import_ui4.Box, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: 1.5, p: 4 } }, /* @__PURE__ */ React4.createElement(import_ui4.CircularProgress, { size: 32 }), /* @__PURE__ */ React4.createElement(import_ui4.Typography, { variant: "body2" }, (0, import_i18n4.__)("Audit in progress.", "elementor")));
|
|
804
836
|
}
|
|
805
837
|
|
|
806
838
|
// src/components/pages/welcome-page.tsx
|
|
807
|
-
var
|
|
808
|
-
var
|
|
839
|
+
var React5 = __toESM(require("react"));
|
|
840
|
+
var import_ui5 = require("@elementor/ui");
|
|
809
841
|
var import_i18n5 = require("@wordpress/i18n");
|
|
810
842
|
var INFORMATION_IMAGE_PATH = "images/information.svg";
|
|
811
843
|
function WelcomePage() {
|
|
812
844
|
const assetsUrl = window.elementorCommon?.config?.urls?.assets ?? "";
|
|
813
|
-
return /* @__PURE__ */
|
|
814
|
-
|
|
845
|
+
return /* @__PURE__ */ React5.createElement(
|
|
846
|
+
import_ui5.Box,
|
|
815
847
|
{
|
|
816
848
|
sx: {
|
|
817
849
|
display: "flex",
|
|
@@ -822,7 +854,7 @@ function WelcomePage() {
|
|
|
822
854
|
p: 3
|
|
823
855
|
}
|
|
824
856
|
},
|
|
825
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ React5.createElement(
|
|
826
858
|
"img",
|
|
827
859
|
{
|
|
828
860
|
className: "elementor-nerd-box-icon",
|
|
@@ -831,8 +863,8 @@ function WelcomePage() {
|
|
|
831
863
|
alt: (0, import_i18n5.__)("Elementor", "elementor")
|
|
832
864
|
}
|
|
833
865
|
),
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ React5.createElement(import_ui5.Typography, { variant: "subtitle1", component: "h3", sx: { marginBlockStart: 2 } }, (0, import_i18n5.__)("Audit your page!", "elementor")),
|
|
867
|
+
/* @__PURE__ */ React5.createElement(import_ui5.Typography, { variant: "caption", textAlign: "center" }, (0, import_i18n5.__)(
|
|
836
868
|
'Check SEO, accessibility, performance, and best practices. Click "Run page audit" to begin.',
|
|
837
869
|
"elementor"
|
|
838
870
|
))
|
|
@@ -840,13 +872,13 @@ function WelcomePage() {
|
|
|
840
872
|
}
|
|
841
873
|
|
|
842
874
|
// src/components/report-shell.tsx
|
|
843
|
-
var
|
|
875
|
+
var React19 = __toESM(require("react"));
|
|
844
876
|
var import_react5 = require("react");
|
|
845
|
-
var
|
|
877
|
+
var import_ui18 = require("@elementor/ui");
|
|
846
878
|
|
|
847
879
|
// src/components/pages/category-page.tsx
|
|
848
|
-
var
|
|
849
|
-
var
|
|
880
|
+
var React13 = __toESM(require("react"));
|
|
881
|
+
var import_ui12 = require("@elementor/ui");
|
|
850
882
|
var import_i18n11 = require("@wordpress/i18n");
|
|
851
883
|
|
|
852
884
|
// src/hooks/use-single-expanded-card.ts
|
|
@@ -860,40 +892,40 @@ function useSingleExpandedCard(initialId = null) {
|
|
|
860
892
|
}
|
|
861
893
|
|
|
862
894
|
// src/components/category-icons.ts
|
|
863
|
-
var
|
|
895
|
+
var import_icons3 = require("@elementor/icons");
|
|
864
896
|
var CATEGORY_ICONS = {
|
|
865
|
-
"best-practices":
|
|
866
|
-
seo:
|
|
867
|
-
accessibility:
|
|
868
|
-
performance:
|
|
869
|
-
compliance:
|
|
897
|
+
"best-practices": import_icons3.Settings2Icon,
|
|
898
|
+
seo: import_icons3.FileSearchIcon,
|
|
899
|
+
accessibility: import_icons3.ElementorAccessibilityIcon,
|
|
900
|
+
performance: import_icons3.BoltIcon,
|
|
901
|
+
compliance: import_icons3.ShieldCheckIcon
|
|
870
902
|
};
|
|
871
903
|
|
|
872
904
|
// src/components/status-section.tsx
|
|
873
|
-
var
|
|
905
|
+
var React6 = __toESM(require("react"));
|
|
874
906
|
var import_react4 = require("react");
|
|
875
|
-
var
|
|
876
|
-
var
|
|
907
|
+
var import_icons4 = require("@elementor/icons");
|
|
908
|
+
var import_ui6 = require("@elementor/ui");
|
|
877
909
|
var import_i18n6 = require("@wordpress/i18n");
|
|
878
910
|
function StatusSection({ label, count, color = "default", defaultExpanded = false, children }) {
|
|
879
911
|
const [expanded, setExpanded] = (0, import_react4.useState)(defaultExpanded);
|
|
880
|
-
if (
|
|
912
|
+
if (React6.Children.count(children) === 0) {
|
|
881
913
|
return null;
|
|
882
914
|
}
|
|
883
|
-
return /* @__PURE__ */
|
|
884
|
-
|
|
915
|
+
return /* @__PURE__ */ React6.createElement(import_ui6.Box, { sx: { paddingBlock: 1 } }, /* @__PURE__ */ React6.createElement(
|
|
916
|
+
import_ui6.Box,
|
|
885
917
|
{
|
|
886
918
|
sx: { display: "flex", alignItems: "center", gap: 0.5, cursor: "pointer" },
|
|
887
919
|
onClick: () => setExpanded((v) => !v)
|
|
888
920
|
},
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
|
|
921
|
+
/* @__PURE__ */ React6.createElement(
|
|
922
|
+
import_ui6.IconButton,
|
|
891
923
|
{
|
|
892
924
|
size: "small",
|
|
893
925
|
"aria-label": expanded ? (0, import_i18n6.__)("Collapse", "elementor") : (0, import_i18n6.__)("Expand", "elementor")
|
|
894
926
|
},
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
|
|
927
|
+
/* @__PURE__ */ React6.createElement(
|
|
928
|
+
import_icons4.ChevronDownIcon,
|
|
897
929
|
{
|
|
898
930
|
fontSize: "small",
|
|
899
931
|
sx: {
|
|
@@ -903,26 +935,26 @@ function StatusSection({ label, count, color = "default", defaultExpanded = fals
|
|
|
903
935
|
}
|
|
904
936
|
)
|
|
905
937
|
),
|
|
906
|
-
/* @__PURE__ */
|
|
907
|
-
), /* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ React6.createElement(import_ui6.Chip, { label: `${label} (${count})`, size: "small", color, variant: "standard" })
|
|
939
|
+
), /* @__PURE__ */ React6.createElement(import_ui6.Collapse, { in: expanded }, /* @__PURE__ */ React6.createElement(import_ui6.Box, { sx: { paddingInlineStart: 4.25, paddingBlock: 2 } }, children)));
|
|
908
940
|
}
|
|
909
941
|
|
|
910
942
|
// src/components/subpage-header.tsx
|
|
911
|
-
var
|
|
912
|
-
var
|
|
913
|
-
var
|
|
943
|
+
var React7 = __toESM(require("react"));
|
|
944
|
+
var import_icons5 = require("@elementor/icons");
|
|
945
|
+
var import_ui7 = require("@elementor/ui");
|
|
914
946
|
var import_i18n7 = require("@wordpress/i18n");
|
|
915
947
|
function SubpageHeader({ title, onBack, backLabel, icon }) {
|
|
916
|
-
const isRtl = "rtl" === (0,
|
|
917
|
-
return /* @__PURE__ */
|
|
948
|
+
const isRtl = "rtl" === (0, import_ui7.useTheme)().direction;
|
|
949
|
+
return /* @__PURE__ */ React7.createElement(import_ui7.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5, p: 1 } }, /* @__PURE__ */ React7.createElement(import_ui7.IconButton, { size: "small", onClick: onBack, "aria-label": backLabel ?? (0, import_i18n7.__)("Back", "elementor") }, /* @__PURE__ */ React7.createElement(import_ui7.Rotate, { in: isRtl }, /* @__PURE__ */ React7.createElement(import_icons5.ArrowLeftIcon, { fontSize: "small" }))), icon, /* @__PURE__ */ React7.createElement(import_ui7.Typography, { variant: "subtitle2", fontWeight: "bold" }, title));
|
|
918
950
|
}
|
|
919
951
|
|
|
920
952
|
// src/components/violation-row.tsx
|
|
921
|
-
var
|
|
953
|
+
var React12 = __toESM(require("react"));
|
|
922
954
|
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
923
955
|
var import_editor_floating_panels2 = require("@elementor/editor-floating-panels");
|
|
924
|
-
var
|
|
925
|
-
var
|
|
956
|
+
var import_icons10 = require("@elementor/icons");
|
|
957
|
+
var import_ui11 = require("@elementor/ui");
|
|
926
958
|
var import_i18n10 = require("@wordpress/i18n");
|
|
927
959
|
|
|
928
960
|
// src/hooks/focus-violation.ts
|
|
@@ -984,10 +1016,10 @@ function onKeyboardClick(callback) {
|
|
|
984
1016
|
}
|
|
985
1017
|
|
|
986
1018
|
// src/components/fix-violation-with-angie.tsx
|
|
987
|
-
var
|
|
1019
|
+
var React8 = __toESM(require("react"));
|
|
988
1020
|
var import_editor_mcp = require("@elementor/editor-mcp");
|
|
989
|
-
var
|
|
990
|
-
var
|
|
1021
|
+
var import_icons6 = require("@elementor/icons");
|
|
1022
|
+
var import_ui8 = require("@elementor/ui");
|
|
991
1023
|
var import_i18n9 = require("@wordpress/i18n");
|
|
992
1024
|
function FixViolationWithAngie({ prompt, panelZIndex }) {
|
|
993
1025
|
const label = (0, import_i18n9.__)("Fix with Angie", "elementor");
|
|
@@ -1008,39 +1040,39 @@ function FixViolationWithAngie({ prompt, panelZIndex }) {
|
|
|
1008
1040
|
})
|
|
1009
1041
|
);
|
|
1010
1042
|
};
|
|
1011
|
-
return /* @__PURE__ */
|
|
1043
|
+
return /* @__PURE__ */ React8.createElement(import_ui8.Tooltip, { title: label, placement: "top", PopperProps: { sx: { zIndex: panelZIndex } } }, /* @__PURE__ */ React8.createElement(import_ui8.IconButton, { component: "a", href, size: "small", "aria-label": label, onClick: handleClick }, /* @__PURE__ */ React8.createElement(import_icons6.AngieIcon, { fontSize: "tiny" })));
|
|
1012
1044
|
}
|
|
1013
1045
|
|
|
1014
1046
|
// src/components/severity-icons.tsx
|
|
1015
|
-
var
|
|
1016
|
-
var
|
|
1047
|
+
var React9 = __toESM(require("react"));
|
|
1048
|
+
var import_icons7 = require("@elementor/icons");
|
|
1017
1049
|
var SEVERITY_CONFIG = {
|
|
1018
|
-
error: { Icon:
|
|
1019
|
-
warning: { Icon:
|
|
1020
|
-
info: { Icon:
|
|
1050
|
+
error: { Icon: import_icons7.AlertTriangleFilledIcon, color: "error" },
|
|
1051
|
+
warning: { Icon: import_icons7.AlertCircleIcon, color: "warning" },
|
|
1052
|
+
info: { Icon: import_icons7.BulbIcon, color: "info" }
|
|
1021
1053
|
};
|
|
1022
1054
|
function SeverityIcon({ severity }) {
|
|
1023
1055
|
const { Icon, color } = SEVERITY_CONFIG[severity];
|
|
1024
|
-
return /* @__PURE__ */
|
|
1056
|
+
return /* @__PURE__ */ React9.createElement(Icon, { fontSize: "small", color });
|
|
1025
1057
|
}
|
|
1026
1058
|
|
|
1027
1059
|
// src/components/violation-cta-button.tsx
|
|
1028
|
-
var
|
|
1029
|
-
var
|
|
1030
|
-
var
|
|
1060
|
+
var React10 = __toESM(require("react"));
|
|
1061
|
+
var import_icons8 = require("@elementor/icons");
|
|
1062
|
+
var import_ui9 = require("@elementor/ui");
|
|
1031
1063
|
function ViolationCtaButton({ ctaLabel, externalUrl, variant = "outlined", withIcon = false }) {
|
|
1032
1064
|
const handleClick = (event) => {
|
|
1033
1065
|
event.stopPropagation();
|
|
1034
1066
|
event.preventDefault();
|
|
1035
1067
|
window.open(externalUrl, "_blank", "noopener");
|
|
1036
1068
|
};
|
|
1037
|
-
return /* @__PURE__ */
|
|
1038
|
-
|
|
1069
|
+
return /* @__PURE__ */ React10.createElement(
|
|
1070
|
+
import_ui9.Button,
|
|
1039
1071
|
{
|
|
1040
1072
|
variant,
|
|
1041
1073
|
color: "secondary",
|
|
1042
1074
|
size: "small",
|
|
1043
|
-
startIcon: withIcon ? /* @__PURE__ */
|
|
1075
|
+
startIcon: withIcon ? /* @__PURE__ */ React10.createElement(import_icons8.WandIcon, { fontSize: "tiny", "aria-hidden": true }) : void 0,
|
|
1044
1076
|
onClick: handleClick
|
|
1045
1077
|
},
|
|
1046
1078
|
ctaLabel
|
|
@@ -1048,13 +1080,13 @@ function ViolationCtaButton({ ctaLabel, externalUrl, variant = "outlined", withI
|
|
|
1048
1080
|
}
|
|
1049
1081
|
|
|
1050
1082
|
// src/components/violation-icons.tsx
|
|
1051
|
-
var
|
|
1052
|
-
var
|
|
1053
|
-
var
|
|
1083
|
+
var React11 = __toESM(require("react"));
|
|
1084
|
+
var import_icons9 = require("@elementor/icons");
|
|
1085
|
+
var import_ui10 = require("@elementor/ui");
|
|
1054
1086
|
function ViolationIcon({ violation, widgetIcon }) {
|
|
1055
1087
|
if (widgetIcon) {
|
|
1056
|
-
return /* @__PURE__ */
|
|
1057
|
-
|
|
1088
|
+
return /* @__PURE__ */ React11.createElement(
|
|
1089
|
+
import_ui10.Box,
|
|
1058
1090
|
{
|
|
1059
1091
|
component: "i",
|
|
1060
1092
|
className: widgetIcon,
|
|
@@ -1064,37 +1096,37 @@ function ViolationIcon({ violation, widgetIcon }) {
|
|
|
1064
1096
|
);
|
|
1065
1097
|
}
|
|
1066
1098
|
if (violation.targetHint === "page-settings") {
|
|
1067
|
-
return /* @__PURE__ */
|
|
1099
|
+
return /* @__PURE__ */ React11.createElement(import_icons9.FileSettingsIcon, { fontSize: "inherit", "aria-hidden": true });
|
|
1068
1100
|
}
|
|
1069
1101
|
if (violation.targetHint === "site-settings" || violation.targetHint === "site-identity-settings") {
|
|
1070
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ React11.createElement(import_icons9.SettingsIcon, { fontSize: "inherit", "aria-hidden": true });
|
|
1071
1103
|
}
|
|
1072
|
-
return /* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ React11.createElement(import_icons9.SettingsIcon, { fontSize: "inherit", "aria-hidden": true });
|
|
1073
1105
|
}
|
|
1074
1106
|
|
|
1075
1107
|
// src/components/violation-row.tsx
|
|
1076
1108
|
function SkipReasonTooltip({ reason }) {
|
|
1077
|
-
return /* @__PURE__ */
|
|
1109
|
+
return /* @__PURE__ */ React12.createElement(import_ui11.Tooltip, { title: reason, placement: "top" }, /* @__PURE__ */ React12.createElement(import_ui11.Box, { "aria-label": reason, component: "span", sx: { display: "inline-flex", alignItems: "center" } }, /* @__PURE__ */ React12.createElement(import_icons10.HelpIcon, { fontSize: "small", color: "action" })));
|
|
1078
1110
|
}
|
|
1079
1111
|
function StatusIndicator({ audit: audit26, violations }) {
|
|
1080
1112
|
if (violations) {
|
|
1081
|
-
return /* @__PURE__ */
|
|
1113
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(SeverityIcon, { severity: audit26.severity }), isScoredAudit(audit26) && /* @__PURE__ */ React12.createElement(import_ui11.Typography, { variant: "caption", color: "text.secondary", fontWeight: "bold" }, violations.length));
|
|
1082
1114
|
}
|
|
1083
|
-
return /* @__PURE__ */
|
|
1115
|
+
return /* @__PURE__ */ React12.createElement(import_icons10.CheckIcon, { fontSize: "small", color: "success" });
|
|
1084
1116
|
}
|
|
1085
1117
|
function GuidanceAction({ violation }) {
|
|
1086
1118
|
const hasPrimaryCta = !!(violation.ctaLabel && violation.externalUrl);
|
|
1087
1119
|
if (!hasPrimaryCta) {
|
|
1088
1120
|
return null;
|
|
1089
1121
|
}
|
|
1090
|
-
return /* @__PURE__ */
|
|
1122
|
+
return /* @__PURE__ */ React12.createElement(import_ui11.Box, { display: "flex", alignItems: "center", gap: 1, mt: 1 }, /* @__PURE__ */ React12.createElement(
|
|
1091
1123
|
ViolationCtaButton,
|
|
1092
1124
|
{
|
|
1093
1125
|
ctaLabel: violation.ctaLabel,
|
|
1094
1126
|
externalUrl: violation.externalUrl,
|
|
1095
1127
|
withIcon: true
|
|
1096
1128
|
}
|
|
1097
|
-
), violation.secondaryCtaLabel && violation.secondaryCtaUrl && /* @__PURE__ */
|
|
1129
|
+
), violation.secondaryCtaLabel && violation.secondaryCtaUrl && /* @__PURE__ */ React12.createElement(
|
|
1098
1130
|
ViolationCtaButton,
|
|
1099
1131
|
{
|
|
1100
1132
|
ctaLabel: violation.secondaryCtaLabel,
|
|
@@ -1112,8 +1144,8 @@ function ViolationRow({ audit: audit26, expanded, onToggleExpand, skipReason, vi
|
|
|
1112
1144
|
focusViolation(primaryViolation);
|
|
1113
1145
|
}
|
|
1114
1146
|
};
|
|
1115
|
-
return /* @__PURE__ */
|
|
1116
|
-
|
|
1147
|
+
return /* @__PURE__ */ React12.createElement(import_ui11.Box, { sx: { borderBottom: 1, borderColor: "divider", paddingBlock: 0.5 } }, /* @__PURE__ */ React12.createElement(import_ui11.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, /* @__PURE__ */ React12.createElement(
|
|
1148
|
+
import_ui11.Box,
|
|
1117
1149
|
{
|
|
1118
1150
|
sx: {
|
|
1119
1151
|
alignItems: "center",
|
|
@@ -1125,17 +1157,17 @@ function ViolationRow({ audit: audit26, expanded, onToggleExpand, skipReason, vi
|
|
|
1125
1157
|
},
|
|
1126
1158
|
onClick: onToggleExpand
|
|
1127
1159
|
},
|
|
1128
|
-
/* @__PURE__ */
|
|
1129
|
-
!skipReason && /* @__PURE__ */
|
|
1130
|
-
), skipReason && /* @__PURE__ */
|
|
1131
|
-
|
|
1160
|
+
/* @__PURE__ */ React12.createElement(import_ui11.Typography, { variant: "subtitle2", color: "text.secondary", sx: { flex: 1 } }, audit26.title),
|
|
1161
|
+
!skipReason && /* @__PURE__ */ React12.createElement(StatusIndicator, { audit: audit26, violations })
|
|
1162
|
+
), skipReason && /* @__PURE__ */ React12.createElement(SkipReasonTooltip, { reason: skipReason }), /* @__PURE__ */ React12.createElement(
|
|
1163
|
+
import_ui11.IconButton,
|
|
1132
1164
|
{
|
|
1133
1165
|
size: "small",
|
|
1134
1166
|
"aria-label": expanded ? (0, import_i18n10.__)("Collapse", "elementor") : (0, import_i18n10.__)("Expand", "elementor"),
|
|
1135
1167
|
onClick: onToggleExpand
|
|
1136
1168
|
},
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
|
|
1169
|
+
/* @__PURE__ */ React12.createElement(
|
|
1170
|
+
import_icons10.ChevronDownIcon,
|
|
1139
1171
|
{
|
|
1140
1172
|
fontSize: "small",
|
|
1141
1173
|
sx: {
|
|
@@ -1144,25 +1176,25 @@ function ViolationRow({ audit: audit26, expanded, onToggleExpand, skipReason, vi
|
|
|
1144
1176
|
}
|
|
1145
1177
|
}
|
|
1146
1178
|
)
|
|
1147
|
-
)), /* @__PURE__ */
|
|
1148
|
-
|
|
1179
|
+
)), /* @__PURE__ */ React12.createElement(import_ui11.Collapse, { in: expanded }, /* @__PURE__ */ React12.createElement(import_ui11.Box, { paddingBlock: 1 }, /* @__PURE__ */ React12.createElement(import_ui11.Tooltip, { title: audit26.fixHint, placement: "top" }, /* @__PURE__ */ React12.createElement(
|
|
1180
|
+
import_ui11.Alert,
|
|
1149
1181
|
{
|
|
1150
1182
|
severity: "secondary",
|
|
1151
1183
|
sx: { p: 1, cursor: isGuidanceFocusable ? "pointer" : void 0 },
|
|
1152
|
-
icon: /* @__PURE__ */
|
|
1184
|
+
icon: /* @__PURE__ */ React12.createElement(import_icons10.InfoCircleIcon, { fontSize: "small", "aria-hidden": true }),
|
|
1153
1185
|
role: isGuidanceFocusable ? "button" : void 0,
|
|
1154
1186
|
tabIndex: isGuidanceFocusable ? 0 : void 0,
|
|
1155
1187
|
onClick: isGuidanceFocusable ? handleGuidanceClick : void 0,
|
|
1156
1188
|
onKeyDown: isGuidanceFocusable ? onKeyboardClick(handleGuidanceClick) : void 0
|
|
1157
1189
|
},
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
primaryViolation && /* @__PURE__ */
|
|
1160
|
-
))), violations && violations.length > 0 && /* @__PURE__ */
|
|
1190
|
+
/* @__PURE__ */ React12.createElement(import_ui11.Typography, { variant: "caption", component: "p", color: "text.secondary" }, audit26.description),
|
|
1191
|
+
primaryViolation && /* @__PURE__ */ React12.createElement(GuidanceAction, { violation: primaryViolation })
|
|
1192
|
+
))), violations && violations.length > 0 && /* @__PURE__ */ React12.createElement(import_ui11.Box, { role: "list", sx: { paddingBlockEnd: 1 } }, violations.map((violation, idx) => {
|
|
1161
1193
|
const widgetIcon = violation.elementId ? (0, import_editor_elements5.getElementIcon)(violation.elementId) : null;
|
|
1162
1194
|
const elementTitle = violation.elementId ? (0, import_editor_elements5.getElementTitle)(violation.elementId) : null;
|
|
1163
1195
|
const rowLabel = elementTitle ? `${elementTitle} - ${violation.label}` : violation.label;
|
|
1164
|
-
return /* @__PURE__ */
|
|
1165
|
-
|
|
1196
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1197
|
+
import_ui11.Box,
|
|
1166
1198
|
{
|
|
1167
1199
|
key: idx,
|
|
1168
1200
|
role: "button",
|
|
@@ -1180,15 +1212,15 @@ function ViolationRow({ audit: audit26, expanded, onToggleExpand, skipReason, vi
|
|
|
1180
1212
|
"&:hover": { bgcolor: "action.hover" }
|
|
1181
1213
|
}
|
|
1182
1214
|
},
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
/* @__PURE__ */
|
|
1185
|
-
violation.angieFix ? /* @__PURE__ */
|
|
1215
|
+
/* @__PURE__ */ React12.createElement(ViolationIcon, { violation, widgetIcon }),
|
|
1216
|
+
/* @__PURE__ */ React12.createElement(import_ui11.Box, { sx: { flex: 1 } }, /* @__PURE__ */ React12.createElement(import_ui11.Typography, { variant: "caption" }, rowLabel), violation.detail && /* @__PURE__ */ React12.createElement(import_ui11.Typography, { variant: "caption", color: "text.secondary" }, violation.detail)),
|
|
1217
|
+
violation.angieFix ? /* @__PURE__ */ React12.createElement(
|
|
1186
1218
|
FixViolationWithAngie,
|
|
1187
1219
|
{
|
|
1188
1220
|
prompt: violation.angiePrompt ?? buildAngiePrompt(rowLabel),
|
|
1189
1221
|
panelZIndex
|
|
1190
1222
|
}
|
|
1191
|
-
) : /* @__PURE__ */
|
|
1223
|
+
) : /* @__PURE__ */ React12.createElement(import_icons10.WandIcon, { fontSize: "tiny", "aria-hidden": true })
|
|
1192
1224
|
);
|
|
1193
1225
|
}))));
|
|
1194
1226
|
}
|
|
@@ -1198,15 +1230,15 @@ function CategoryPage({ category, report, onBack }) {
|
|
|
1198
1230
|
const Icon = CATEGORY_ICONS[category];
|
|
1199
1231
|
const { failed, passed, skipped, totalViolations } = partitionAuditResults(report, { category });
|
|
1200
1232
|
const { expandedId, toggle } = useSingleExpandedCard();
|
|
1201
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
|
|
1202
1234
|
SubpageHeader,
|
|
1203
1235
|
{
|
|
1204
1236
|
title: CATEGORY_LABELS[category],
|
|
1205
1237
|
onBack,
|
|
1206
1238
|
backLabel: (0, import_i18n11.__)("Back to all issues", "elementor"),
|
|
1207
|
-
icon: /* @__PURE__ */
|
|
1239
|
+
icon: /* @__PURE__ */ React13.createElement(Icon, { fontSize: "small", color: "action" })
|
|
1208
1240
|
}
|
|
1209
|
-
), /* @__PURE__ */
|
|
1241
|
+
), /* @__PURE__ */ React13.createElement(import_ui12.Box, { sx: { p: 1 } }, /* @__PURE__ */ React13.createElement(
|
|
1210
1242
|
StatusSection,
|
|
1211
1243
|
{
|
|
1212
1244
|
label: (0, import_i18n11.__)("Failed audits", "elementor"),
|
|
@@ -1214,7 +1246,7 @@ function CategoryPage({ category, report, onBack }) {
|
|
|
1214
1246
|
color: "error",
|
|
1215
1247
|
defaultExpanded: true
|
|
1216
1248
|
},
|
|
1217
|
-
failed.map((r) => /* @__PURE__ */
|
|
1249
|
+
failed.map((r) => /* @__PURE__ */ React13.createElement(
|
|
1218
1250
|
ViolationRow,
|
|
1219
1251
|
{
|
|
1220
1252
|
key: r.audit.id,
|
|
@@ -1224,7 +1256,7 @@ function CategoryPage({ category, report, onBack }) {
|
|
|
1224
1256
|
onToggleExpand: () => toggle(r.audit.id)
|
|
1225
1257
|
}
|
|
1226
1258
|
))
|
|
1227
|
-
), /* @__PURE__ */
|
|
1259
|
+
), /* @__PURE__ */ React13.createElement(StatusSection, { label: (0, import_i18n11.__)("Passed audits", "elementor"), count: passed.length, color: "success" }, passed.map((r) => /* @__PURE__ */ React13.createElement(
|
|
1228
1260
|
ViolationRow,
|
|
1229
1261
|
{
|
|
1230
1262
|
key: r.audit.id,
|
|
@@ -1232,7 +1264,7 @@ function CategoryPage({ category, report, onBack }) {
|
|
|
1232
1264
|
expanded: expandedId === r.audit.id,
|
|
1233
1265
|
onToggleExpand: () => toggle(r.audit.id)
|
|
1234
1266
|
}
|
|
1235
|
-
))), /* @__PURE__ */
|
|
1267
|
+
))), /* @__PURE__ */ React13.createElement(StatusSection, { label: (0, import_i18n11.__)("Skipped audits", "elementor"), count: skipped.length, color: "default" }, skipped.map((r) => /* @__PURE__ */ React13.createElement(
|
|
1236
1268
|
ViolationRow,
|
|
1237
1269
|
{
|
|
1238
1270
|
key: r.audit.id,
|
|
@@ -1245,8 +1277,8 @@ function CategoryPage({ category, report, onBack }) {
|
|
|
1245
1277
|
}
|
|
1246
1278
|
|
|
1247
1279
|
// src/components/pages/overview-page.tsx
|
|
1248
|
-
var
|
|
1249
|
-
var
|
|
1280
|
+
var React18 = __toESM(require("react"));
|
|
1281
|
+
var import_ui17 = require("@elementor/ui");
|
|
1250
1282
|
var import_i18n15 = require("@wordpress/i18n");
|
|
1251
1283
|
|
|
1252
1284
|
// src/utils/severity-counts.ts
|
|
@@ -1280,14 +1312,14 @@ function severityPluralLabel(severity) {
|
|
|
1280
1312
|
}
|
|
1281
1313
|
|
|
1282
1314
|
// src/components/issues-category-row.tsx
|
|
1283
|
-
var
|
|
1284
|
-
var
|
|
1285
|
-
var
|
|
1315
|
+
var React14 = __toESM(require("react"));
|
|
1316
|
+
var import_icons11 = require("@elementor/icons");
|
|
1317
|
+
var import_ui13 = require("@elementor/ui");
|
|
1286
1318
|
function IssuesCategoryRow({ category, label, counts, onClick }) {
|
|
1287
|
-
const isRtl = "rtl" === (0,
|
|
1319
|
+
const isRtl = "rtl" === (0, import_ui13.useTheme)().direction;
|
|
1288
1320
|
const Icon = CATEGORY_ICONS[category];
|
|
1289
|
-
return /* @__PURE__ */
|
|
1290
|
-
|
|
1321
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1322
|
+
import_ui13.Box,
|
|
1291
1323
|
{
|
|
1292
1324
|
role: "button",
|
|
1293
1325
|
tabIndex: 0,
|
|
@@ -1308,20 +1340,20 @@ function IssuesCategoryRow({ category, label, counts, onClick }) {
|
|
|
1308
1340
|
"&:focus-visible": { outline: "2px solid", outlineColor: "primary.main" }
|
|
1309
1341
|
}
|
|
1310
1342
|
},
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
/* @__PURE__ */
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1343
|
+
/* @__PURE__ */ React14.createElement(Icon, { fontSize: "small", color: "action" }),
|
|
1344
|
+
/* @__PURE__ */ React14.createElement(import_ui13.Typography, { variant: "body2", fontWeight: "bold", sx: { flex: 1 } }, label),
|
|
1345
|
+
/* @__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])))),
|
|
1346
|
+
/* @__PURE__ */ React14.createElement(import_ui13.Rotate, { in: isRtl }, /* @__PURE__ */ React14.createElement(import_icons11.ChevronRightIcon, { fontSize: "small", color: "action" }))
|
|
1315
1347
|
);
|
|
1316
1348
|
}
|
|
1317
1349
|
|
|
1318
1350
|
// src/components/promotions.tsx
|
|
1319
|
-
var
|
|
1320
|
-
var
|
|
1351
|
+
var React16 = __toESM(require("react"));
|
|
1352
|
+
var import_ui15 = require("@elementor/ui");
|
|
1321
1353
|
var import_i18n14 = require("@wordpress/i18n");
|
|
1322
1354
|
|
|
1323
1355
|
// src/register-promotions.ts
|
|
1324
|
-
var
|
|
1356
|
+
var import_icons12 = require("@elementor/icons");
|
|
1325
1357
|
var import_i18n13 = require("@wordpress/i18n");
|
|
1326
1358
|
function firstFailExternalUrl(run) {
|
|
1327
1359
|
return run.result.status === "fail" ? run.result.violations[0]?.externalUrl : void 0;
|
|
@@ -1329,7 +1361,7 @@ function firstFailExternalUrl(run) {
|
|
|
1329
1361
|
var PROMOTIONS = [
|
|
1330
1362
|
{
|
|
1331
1363
|
auditId: "audits/images-alt-text",
|
|
1332
|
-
icon:
|
|
1364
|
+
icon: import_icons12.PhotoIcon,
|
|
1333
1365
|
ctaLabel: (0, import_i18n13.__)("Fix with Ally", "elementor"),
|
|
1334
1366
|
formatSubtitle: (run) => {
|
|
1335
1367
|
if (run.result.status !== "fail") {
|
|
@@ -1349,21 +1381,21 @@ var PROMOTIONS = [
|
|
|
1349
1381
|
},
|
|
1350
1382
|
{
|
|
1351
1383
|
auditId: "audits/cookie-policy",
|
|
1352
|
-
icon:
|
|
1384
|
+
icon: import_icons12.ElementorCookieIcon,
|
|
1353
1385
|
ctaLabel: (0, import_i18n13.__)("Fix with Cookiez", "elementor"),
|
|
1354
1386
|
formatSubtitle: (run) => run.result.status === "fail" ? (0, import_i18n13.__)("Generate cookie policy", "elementor") : null,
|
|
1355
1387
|
getCtaUrl: firstFailExternalUrl
|
|
1356
1388
|
},
|
|
1357
1389
|
{
|
|
1358
1390
|
auditId: "audits/scan-for-cookies",
|
|
1359
|
-
icon:
|
|
1391
|
+
icon: import_icons12.ElementorCookieIcon,
|
|
1360
1392
|
ctaLabel: (0, import_i18n13.__)("Scan", "elementor"),
|
|
1361
1393
|
formatSubtitle: (run) => run.result.status === "fail" ? (0, import_i18n13.__)("Scan this page for cookies", "elementor") : null,
|
|
1362
1394
|
getCtaUrl: firstFailExternalUrl
|
|
1363
1395
|
},
|
|
1364
1396
|
{
|
|
1365
1397
|
auditId: "audits/images-too-large",
|
|
1366
|
-
icon:
|
|
1398
|
+
icon: import_icons12.ShieldHalfFilledIcon,
|
|
1367
1399
|
ctaLabel: (0, import_i18n13.__)("Optimize all", "elementor"),
|
|
1368
1400
|
formatSubtitle: (run) => {
|
|
1369
1401
|
if (run.result.status !== "fail") {
|
|
@@ -1389,11 +1421,11 @@ function findAuditRun(report, auditId) {
|
|
|
1389
1421
|
}
|
|
1390
1422
|
|
|
1391
1423
|
// src/components/promotion-card.tsx
|
|
1392
|
-
var
|
|
1393
|
-
var
|
|
1424
|
+
var React15 = __toESM(require("react"));
|
|
1425
|
+
var import_ui14 = require("@elementor/ui");
|
|
1394
1426
|
function PromotionCard({ ctaDisabled, ctaLabel, icon: Icon, onCtaClick, subtitle, title }) {
|
|
1395
|
-
return /* @__PURE__ */
|
|
1396
|
-
|
|
1427
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1428
|
+
import_ui14.Box,
|
|
1397
1429
|
{
|
|
1398
1430
|
sx: {
|
|
1399
1431
|
alignItems: "center",
|
|
@@ -1406,9 +1438,9 @@ function PromotionCard({ ctaDisabled, ctaLabel, icon: Icon, onCtaClick, subtitle
|
|
|
1406
1438
|
py: 1.5
|
|
1407
1439
|
}
|
|
1408
1440
|
},
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1411
|
-
/* @__PURE__ */
|
|
1441
|
+
/* @__PURE__ */ React15.createElement(Icon, { fontSize: "small", color: "action" }),
|
|
1442
|
+
/* @__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)),
|
|
1443
|
+
/* @__PURE__ */ React15.createElement(import_ui14.Button, { variant: "outlined", color: "secondary", size: "small", disabled: ctaDisabled, onClick: onCtaClick }, ctaLabel)
|
|
1412
1444
|
);
|
|
1413
1445
|
}
|
|
1414
1446
|
|
|
@@ -1437,7 +1469,7 @@ function Promotions({ report }) {
|
|
|
1437
1469
|
if (cards.length === 0) {
|
|
1438
1470
|
return null;
|
|
1439
1471
|
}
|
|
1440
|
-
return /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(import_ui15.Divider, null), /* @__PURE__ */ React16.createElement(import_ui15.Typography, { variant: "subtitle1", fontWeight: "bold" }, (0, import_i18n14.__)("Quick actions", "elementor")), /* @__PURE__ */ React16.createElement(import_ui15.Box, { sx: { display: "flex", flexDirection: "column", gap: 1 } }, cards.map(({ config, ctaUrl, key, run, subtitle }) => /* @__PURE__ */ React16.createElement(
|
|
1441
1473
|
PromotionCard,
|
|
1442
1474
|
{
|
|
1443
1475
|
key,
|
|
@@ -1456,15 +1488,15 @@ function Promotions({ report }) {
|
|
|
1456
1488
|
}
|
|
1457
1489
|
|
|
1458
1490
|
// src/components/severity-summary-cards.tsx
|
|
1459
|
-
var
|
|
1460
|
-
var
|
|
1491
|
+
var React17 = __toESM(require("react"));
|
|
1492
|
+
var import_ui16 = require("@elementor/ui");
|
|
1461
1493
|
function SeveritySummaryCards({ report }) {
|
|
1462
1494
|
const counts = countSeverities(report);
|
|
1463
|
-
return /* @__PURE__ */
|
|
1495
|
+
return /* @__PURE__ */ React17.createElement(import_ui16.Box, { display: "flex", gap: 1.5 }, ALL_SEVERITIES.map((severity) => /* @__PURE__ */ React17.createElement(SeverityCard, { key: severity, severity, count: counts[severity] })));
|
|
1464
1496
|
}
|
|
1465
1497
|
function SeverityCard({ severity, count }) {
|
|
1466
|
-
return /* @__PURE__ */
|
|
1467
|
-
|
|
1498
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1499
|
+
import_ui16.Box,
|
|
1468
1500
|
{
|
|
1469
1501
|
display: "flex",
|
|
1470
1502
|
flex: 1,
|
|
@@ -1475,8 +1507,8 @@ function SeverityCard({ severity, count }) {
|
|
|
1475
1507
|
px: 1.5,
|
|
1476
1508
|
py: 1
|
|
1477
1509
|
},
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ React17.createElement(SeverityIcon, { severity }),
|
|
1511
|
+
/* @__PURE__ */ React17.createElement(import_ui16.Box, { display: "flex", flexDirection: "column" }, /* @__PURE__ */ React17.createElement(import_ui16.Typography, { variant: "h5", fontWeight: 700, component: "span" }, count), /* @__PURE__ */ React17.createElement(import_ui16.Typography, { variant: "caption", color: "text.secondary" }, severityPluralLabel(severity)))
|
|
1480
1512
|
);
|
|
1481
1513
|
}
|
|
1482
1514
|
|
|
@@ -1484,7 +1516,7 @@ function SeverityCard({ severity, count }) {
|
|
|
1484
1516
|
function OverviewPage({ onCategoryClick, report }) {
|
|
1485
1517
|
const populatedCategories = getPopulatedCategories(report.categories, ALL_CATEGORIES);
|
|
1486
1518
|
const categoryRows = populatedCategories.map((category) => ({ category, counts: countSeverities(report, category) })).filter(({ counts }) => Object.values(counts).some((count) => count > 0));
|
|
1487
|
-
return /* @__PURE__ */
|
|
1519
|
+
return /* @__PURE__ */ React18.createElement(import_ui17.Box, { display: "flex", flexDirection: "column", gap: 3, p: 2 }, /* @__PURE__ */ React18.createElement(SeveritySummaryCards, { report }), /* @__PURE__ */ React18.createElement(import_ui17.Box, { display: "flex", flexDirection: "column", gap: 1 }, /* @__PURE__ */ React18.createElement(import_ui17.Typography, { variant: "subtitle1", component: "h2" }, (0, import_i18n15.__)("All issues", "elementor")), /* @__PURE__ */ React18.createElement(import_ui17.Box, { display: "flex", flexDirection: "column", gap: 1 }, categoryRows.map(({ category, counts }) => /* @__PURE__ */ React18.createElement(
|
|
1488
1520
|
IssuesCategoryRow,
|
|
1489
1521
|
{
|
|
1490
1522
|
key: category,
|
|
@@ -1493,7 +1525,7 @@ function OverviewPage({ onCategoryClick, report }) {
|
|
|
1493
1525
|
counts,
|
|
1494
1526
|
onClick: () => onCategoryClick(category)
|
|
1495
1527
|
}
|
|
1496
|
-
)))), /* @__PURE__ */
|
|
1528
|
+
)))), /* @__PURE__ */ React18.createElement(Promotions, { report }));
|
|
1497
1529
|
}
|
|
1498
1530
|
|
|
1499
1531
|
// src/components/report-shell.tsx
|
|
@@ -1504,47 +1536,74 @@ function ReportShell({ report }) {
|
|
|
1504
1536
|
const [activePage, setActivePage] = (0, import_react5.useState)("overview");
|
|
1505
1537
|
const openCategory = (category) => setActivePage({ category });
|
|
1506
1538
|
const backToOverview = () => setActivePage("overview");
|
|
1507
|
-
return /* @__PURE__ */
|
|
1539
|
+
return /* @__PURE__ */ React19.createElement(import_ui18.Box, { sx: { flex: 1, minHeight: 0, overflowY: "auto" } }, activePage === "overview" && /* @__PURE__ */ React19.createElement(OverviewPage, { report, onCategoryClick: openCategory }), isCategoryPage(activePage) && /* @__PURE__ */ React19.createElement(CategoryPage, { category: activePage.category, report, onBack: backToOverview }));
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
// src/components/rescan-button.tsx
|
|
1543
|
+
var React20 = __toESM(require("react"));
|
|
1544
|
+
var import_editor_floating_panels3 = require("@elementor/editor-floating-panels");
|
|
1545
|
+
var import_icons13 = require("@elementor/icons");
|
|
1546
|
+
var import_ui19 = require("@elementor/ui");
|
|
1547
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
1548
|
+
function RescanButton({ hasScanned, isStale, disabled, onClick }) {
|
|
1549
|
+
const panelZIndex = (0, import_editor_floating_panels3.useFloatingPanelZIndex)(AUDIT_PANEL_ID);
|
|
1550
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1551
|
+
import_ui19.Tooltip,
|
|
1552
|
+
{
|
|
1553
|
+
title: (0, import_i18n16.__)("Page content changed - rescan advised", "elementor"),
|
|
1554
|
+
disableHoverListener: !isStale,
|
|
1555
|
+
PopperProps: { sx: { zIndex: panelZIndex } }
|
|
1556
|
+
},
|
|
1557
|
+
/* @__PURE__ */ React20.createElement(import_ui19.Badge, { variant: "dot", color: "warning", invisible: !isStale, overlap: "rectangular" }, /* @__PURE__ */ React20.createElement(
|
|
1558
|
+
import_ui19.Button,
|
|
1559
|
+
{
|
|
1560
|
+
variant: "contained",
|
|
1561
|
+
size: "small",
|
|
1562
|
+
startIcon: hasScanned ? /* @__PURE__ */ React20.createElement(import_icons13.ReloadIcon, { fontSize: "small" }) : void 0,
|
|
1563
|
+
onClick,
|
|
1564
|
+
disabled
|
|
1565
|
+
},
|
|
1566
|
+
hasScanned ? (0, import_i18n16.__)("Rescan", "elementor") : (0, import_i18n16.__)("Run page audit", "elementor")
|
|
1567
|
+
))
|
|
1568
|
+
);
|
|
1508
1569
|
}
|
|
1509
1570
|
|
|
1510
1571
|
// src/components/audit-panel.tsx
|
|
1511
1572
|
function AuditPanel() {
|
|
1512
|
-
const { status, report, error, run } = useAuditReport();
|
|
1573
|
+
const { status, report, error, isStale, run } = useAuditReport();
|
|
1513
1574
|
const hostDocumentId = (0, import_editor_elements6.getHostDocumentId)() ?? 0;
|
|
1514
1575
|
const onRun = () => run(hostDocumentId);
|
|
1515
1576
|
const lastScanLabel = report ? new Date(report.runAt).toLocaleTimeString() : null;
|
|
1516
|
-
return /* @__PURE__ */
|
|
1517
|
-
|
|
1577
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
1578
|
+
import_editor_floating_panels4.FloatingPanelHeader,
|
|
1518
1579
|
{
|
|
1519
1580
|
panelId: AUDIT_PANEL_ID,
|
|
1520
|
-
title: (0,
|
|
1521
|
-
badge: (0,
|
|
1581
|
+
title: (0, import_i18n17.__)("Page Audit", "elementor"),
|
|
1582
|
+
badge: (0, import_i18n17.__)("Beta", "elementor"),
|
|
1522
1583
|
titleVariant: "subtitle2"
|
|
1523
1584
|
}
|
|
1524
|
-
), /* @__PURE__ */
|
|
1525
|
-
|
|
1585
|
+
), /* @__PURE__ */ React21.createElement(
|
|
1586
|
+
import_editor_floating_panels4.FloatingPanelBody,
|
|
1526
1587
|
{
|
|
1527
1588
|
sx: status === "ready" ? { display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 } : void 0
|
|
1528
1589
|
},
|
|
1529
|
-
status === "idle" && /* @__PURE__ */
|
|
1530
|
-
status === "loading" && /* @__PURE__ */
|
|
1531
|
-
status === "error" && /* @__PURE__ */
|
|
1532
|
-
status === "ready" && report && /* @__PURE__ */
|
|
1533
|
-
), /* @__PURE__ */
|
|
1534
|
-
|
|
1590
|
+
status === "idle" && /* @__PURE__ */ React21.createElement(WelcomePage, null),
|
|
1591
|
+
status === "loading" && /* @__PURE__ */ React21.createElement(LoadingPage, null),
|
|
1592
|
+
status === "error" && /* @__PURE__ */ React21.createElement(ErrorPage, { message: error ?? "", onRetry: onRun }),
|
|
1593
|
+
status === "ready" && report && /* @__PURE__ */ React21.createElement(ReportShell, { report })
|
|
1594
|
+
), /* @__PURE__ */ React21.createElement(import_editor_floating_panels4.FloatingPanelFooter, null, lastScanLabel ? /* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "caption", sx: { flex: 1 } }, (0, import_i18n17.__)("Last scan:", "elementor"), " ", lastScanLabel) : /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { flex: 1 } }), lastScanLabel && /* @__PURE__ */ React21.createElement(AuditFeedback, null), /* @__PURE__ */ React21.createElement(
|
|
1595
|
+
RescanButton,
|
|
1535
1596
|
{
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
onClick: onRun
|
|
1540
|
-
|
|
1541
|
-
},
|
|
1542
|
-
lastScanLabel ? (0, import_i18n16.__)("Rescan", "elementor") : (0, import_i18n16.__)("Run page audit", "elementor")
|
|
1597
|
+
hasScanned: Boolean(lastScanLabel),
|
|
1598
|
+
isStale,
|
|
1599
|
+
disabled: status === "loading" || hostDocumentId === 0,
|
|
1600
|
+
onClick: onRun
|
|
1601
|
+
}
|
|
1543
1602
|
)));
|
|
1544
1603
|
}
|
|
1545
1604
|
|
|
1546
1605
|
// src/editor-panel.tsx
|
|
1547
|
-
var auditPanel = (0,
|
|
1606
|
+
var auditPanel = (0, import_editor_floating_panels5.createFloatingPanel)({
|
|
1548
1607
|
id: AUDIT_PANEL_ID,
|
|
1549
1608
|
title: "Audit",
|
|
1550
1609
|
icon: () => null,
|
|
@@ -1564,8 +1623,8 @@ function useAuditToggleProps() {
|
|
|
1564
1623
|
const { isOpen } = auditPanel.useFloatingPanelStatus();
|
|
1565
1624
|
const { toggle } = auditPanel.useFloatingPanelActions();
|
|
1566
1625
|
return {
|
|
1567
|
-
title: (0,
|
|
1568
|
-
icon:
|
|
1626
|
+
title: (0, import_i18n18.__)("Audit Page", "elementor"),
|
|
1627
|
+
icon: AuditToggleIcon,
|
|
1569
1628
|
selected: isOpen,
|
|
1570
1629
|
onClick: () => toggle()
|
|
1571
1630
|
};
|
|
@@ -1582,15 +1641,15 @@ function registerAppBarAuditsToggle() {
|
|
|
1582
1641
|
}
|
|
1583
1642
|
|
|
1584
1643
|
// src/audits/accessibility-policy.ts
|
|
1585
|
-
var
|
|
1644
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
1586
1645
|
var audit = {
|
|
1587
1646
|
id: "audits/accessibility-policy",
|
|
1588
|
-
title: (0,
|
|
1589
|
-
description: (0,
|
|
1647
|
+
title: (0, import_i18n19.__)("Accessibility policy", "elementor"),
|
|
1648
|
+
description: (0, import_i18n19.__)(
|
|
1590
1649
|
"An accessibility policy demonstrates your commitment to digital inclusion and may be legally required in some regions.",
|
|
1591
1650
|
"elementor"
|
|
1592
1651
|
),
|
|
1593
|
-
fixHint: (0,
|
|
1652
|
+
fixHint: (0, import_i18n19.__)("Install the Ally plugin to add an accessibility policy to your website.", "elementor"),
|
|
1594
1653
|
categories: ["compliance"],
|
|
1595
1654
|
severity: "info",
|
|
1596
1655
|
weight: 1,
|
|
@@ -1603,7 +1662,7 @@ var audit = {
|
|
|
1603
1662
|
violations: [
|
|
1604
1663
|
{
|
|
1605
1664
|
auditId: audit.id,
|
|
1606
|
-
label: (0,
|
|
1665
|
+
label: (0, import_i18n19.__)("Ally plugin is not installed or active.", "elementor"),
|
|
1607
1666
|
externalUrl: ctx.pageContext.ally_plugin_url
|
|
1608
1667
|
}
|
|
1609
1668
|
]
|
|
@@ -1612,15 +1671,15 @@ var audit = {
|
|
|
1612
1671
|
};
|
|
1613
1672
|
|
|
1614
1673
|
// src/audits/accessibility-statement.ts
|
|
1615
|
-
var
|
|
1674
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
1616
1675
|
var audit2 = {
|
|
1617
1676
|
id: "audits/accessibility-statement",
|
|
1618
|
-
title: (0,
|
|
1619
|
-
description: (0,
|
|
1677
|
+
title: (0, import_i18n20.__)("Create an accessibility statement", "elementor"),
|
|
1678
|
+
description: (0, import_i18n20.__)(
|
|
1620
1679
|
"An accessibility statement showcases your efforts to create an inclusive online space, highlighting helpful features and a commitment to accessibility.",
|
|
1621
1680
|
"elementor"
|
|
1622
1681
|
),
|
|
1623
|
-
fixHint: (0,
|
|
1682
|
+
fixHint: (0, import_i18n20.__)("Use Ally to create and publish an accessibility statement for your site.", "elementor"),
|
|
1624
1683
|
categories: ["accessibility"],
|
|
1625
1684
|
severity: "info",
|
|
1626
1685
|
weight: 1,
|
|
@@ -1634,10 +1693,10 @@ var audit2 = {
|
|
|
1634
1693
|
violations: [
|
|
1635
1694
|
{
|
|
1636
1695
|
auditId: audit2.id,
|
|
1637
|
-
label: (0,
|
|
1696
|
+
label: (0, import_i18n20.__)("No accessibility statement has been created for this site.", "elementor"),
|
|
1638
1697
|
externalUrl: isReady ? ctx.pageContext.ally_accessibility_statement_url : ctx.pageContext.ally_plugin_url,
|
|
1639
|
-
ctaLabel: (0,
|
|
1640
|
-
secondaryCtaLabel: (0,
|
|
1698
|
+
ctaLabel: (0, import_i18n20.__)("Create", "elementor"),
|
|
1699
|
+
secondaryCtaLabel: (0, import_i18n20.__)("Learn more", "elementor"),
|
|
1641
1700
|
secondaryCtaUrl: "https://elementor.com/help/start-using-ally/#statement"
|
|
1642
1701
|
}
|
|
1643
1702
|
]
|
|
@@ -1646,7 +1705,7 @@ var audit2 = {
|
|
|
1646
1705
|
};
|
|
1647
1706
|
|
|
1648
1707
|
// src/audits/accessibility-widget.ts
|
|
1649
|
-
var
|
|
1708
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
1650
1709
|
|
|
1651
1710
|
// src/utils/scan-accessibility-widgets.ts
|
|
1652
1711
|
var ACCESSIBILITY_WIDGET_SCRIPT_SOURCES = ["cdn.elementor.com/a11y/widget.js"];
|
|
@@ -1657,18 +1716,18 @@ function hasAccessibilityWidgetScript(html) {
|
|
|
1657
1716
|
// src/audits/accessibility-widget.ts
|
|
1658
1717
|
var audit3 = {
|
|
1659
1718
|
id: "audits/accessibility-widget",
|
|
1660
|
-
title: (0,
|
|
1661
|
-
description: (0,
|
|
1662
|
-
fixHint: (0,
|
|
1719
|
+
title: (0, import_i18n21.__)("Add an accessibility widget", "elementor"),
|
|
1720
|
+
description: (0, import_i18n21.__)("Make your site more inclusive by adding an accessibility widget.", "elementor"),
|
|
1721
|
+
fixHint: (0, import_i18n21.__)("Activate Ally\u2019s accessibility widget to give visitors on-page accessibility tools.", "elementor"),
|
|
1663
1722
|
categories: ["accessibility"],
|
|
1664
1723
|
severity: "info",
|
|
1665
1724
|
weight: 1,
|
|
1666
1725
|
evaluate: (ctx) => {
|
|
1667
1726
|
if (!ctx.pageContext.frontend_url) {
|
|
1668
|
-
return { status: "skipped", reason: (0,
|
|
1727
|
+
return { status: "skipped", reason: (0, import_i18n21.__)("Page is not published.", "elementor") };
|
|
1669
1728
|
}
|
|
1670
1729
|
if (!ctx.renderedHtml) {
|
|
1671
|
-
return { status: "skipped", reason: (0,
|
|
1730
|
+
return { status: "skipped", reason: (0, import_i18n21.__)("Could not fetch the published page.", "elementor") };
|
|
1672
1731
|
}
|
|
1673
1732
|
if (hasAccessibilityWidgetScript(ctx.renderedHtml)) {
|
|
1674
1733
|
return { status: "pass" };
|
|
@@ -1679,9 +1738,9 @@ var audit3 = {
|
|
|
1679
1738
|
violations: [
|
|
1680
1739
|
{
|
|
1681
1740
|
auditId: audit3.id,
|
|
1682
|
-
label: (0,
|
|
1741
|
+
label: (0, import_i18n21.__)("No accessibility widget is active on this site.", "elementor"),
|
|
1683
1742
|
externalUrl: isReady ? ctx.pageContext.ally_widget_settings_url : ctx.pageContext.ally_plugin_url,
|
|
1684
|
-
ctaLabel: (0,
|
|
1743
|
+
ctaLabel: (0, import_i18n21.__)("Activate", "elementor")
|
|
1685
1744
|
}
|
|
1686
1745
|
]
|
|
1687
1746
|
};
|
|
@@ -1689,15 +1748,15 @@ var audit3 = {
|
|
|
1689
1748
|
};
|
|
1690
1749
|
|
|
1691
1750
|
// src/audits/cookie-policy.ts
|
|
1692
|
-
var
|
|
1751
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
1693
1752
|
var audit4 = {
|
|
1694
1753
|
id: "audits/cookie-policy",
|
|
1695
|
-
title: (0,
|
|
1696
|
-
description: (0,
|
|
1754
|
+
title: (0, import_i18n22.__)("Cookie policy", "elementor"),
|
|
1755
|
+
description: (0, import_i18n22.__)(
|
|
1697
1756
|
"A cookie policy is required by privacy regulations such as GDPR (EU) or CCPA (US) to inform visitors about tracking and data collection.",
|
|
1698
1757
|
"elementor"
|
|
1699
1758
|
),
|
|
1700
|
-
fixHint: (0,
|
|
1759
|
+
fixHint: (0, import_i18n22.__)("Install the Cookiez plugin to add a cookie policy to your website.", "elementor"),
|
|
1701
1760
|
categories: ["compliance"],
|
|
1702
1761
|
severity: "info",
|
|
1703
1762
|
weight: 1,
|
|
@@ -1710,9 +1769,9 @@ var audit4 = {
|
|
|
1710
1769
|
violations: [
|
|
1711
1770
|
{
|
|
1712
1771
|
auditId: audit4.id,
|
|
1713
|
-
label: (0,
|
|
1772
|
+
label: (0, import_i18n22.__)("Cookiez plugin is not installed or active.", "elementor"),
|
|
1714
1773
|
externalUrl: ctx.pageContext.cookiez_plugin_url,
|
|
1715
|
-
ctaLabel: (0,
|
|
1774
|
+
ctaLabel: (0, import_i18n22.__)("Set up cookie consent", "elementor")
|
|
1716
1775
|
}
|
|
1717
1776
|
]
|
|
1718
1777
|
};
|
|
@@ -1721,7 +1780,7 @@ var audit4 = {
|
|
|
1721
1780
|
|
|
1722
1781
|
// src/audits/deep-nesting.ts
|
|
1723
1782
|
var import_editor_elements7 = require("@elementor/editor-elements");
|
|
1724
|
-
var
|
|
1783
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
1725
1784
|
var MAX_NESTING_DEPTH = 6;
|
|
1726
1785
|
function isNestingElement(node, widgetsCache) {
|
|
1727
1786
|
if (node.elType === "container") {
|
|
@@ -1731,18 +1790,18 @@ function isNestingElement(node, widgetsCache) {
|
|
|
1731
1790
|
}
|
|
1732
1791
|
var audit5 = {
|
|
1733
1792
|
id: "audits/deep-nesting",
|
|
1734
|
-
title: (0,
|
|
1735
|
-
description: (0,
|
|
1793
|
+
title: (0, import_i18n23.__)("Deep container nesting", "elementor"),
|
|
1794
|
+
description: (0, import_i18n23.__)(
|
|
1736
1795
|
"Container nesting exceeds the recommended depth. Deep DOM trees hurt rendering performance and readability.",
|
|
1737
1796
|
"elementor"
|
|
1738
1797
|
),
|
|
1739
|
-
fixHint: (0,
|
|
1798
|
+
fixHint: (0, import_i18n23.__)("Flatten the layout by removing unnecessary wrapper containers.", "elementor"),
|
|
1740
1799
|
categories: ["performance", "best-practices"],
|
|
1741
1800
|
severity: "warning",
|
|
1742
1801
|
weight: 5,
|
|
1743
1802
|
evaluate: (ctx) => {
|
|
1744
1803
|
if (ctx.elements.tree.length === 0) {
|
|
1745
|
-
return { status: "skipped", reason: (0,
|
|
1804
|
+
return { status: "skipped", reason: (0, import_i18n23.__)("No elements", "elementor") };
|
|
1746
1805
|
}
|
|
1747
1806
|
const widgetsCache = (0, import_editor_elements7.getWidgetsCache)();
|
|
1748
1807
|
const violations = [];
|
|
@@ -1756,7 +1815,7 @@ var audit5 = {
|
|
|
1756
1815
|
auditId: audit5.id,
|
|
1757
1816
|
elementId: node.id,
|
|
1758
1817
|
targetHint: "element-settings",
|
|
1759
|
-
label: (0,
|
|
1818
|
+
label: (0, import_i18n23.__)("Container nesting is too deep.", "elementor")
|
|
1760
1819
|
});
|
|
1761
1820
|
}
|
|
1762
1821
|
});
|
|
@@ -1765,15 +1824,15 @@ var audit5 = {
|
|
|
1765
1824
|
};
|
|
1766
1825
|
|
|
1767
1826
|
// src/audits/default-design-system.ts
|
|
1768
|
-
var
|
|
1827
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
1769
1828
|
var audit6 = {
|
|
1770
1829
|
id: "audits/default-design-system",
|
|
1771
|
-
title: (0,
|
|
1772
|
-
description: (0,
|
|
1830
|
+
title: (0, import_i18n24.__)("Default website kit", "elementor"),
|
|
1831
|
+
description: (0, import_i18n24.__)(
|
|
1773
1832
|
"Your website is using the default design system colors and fonts. Custom branding makes the website feel uniquely yours.",
|
|
1774
1833
|
"elementor"
|
|
1775
1834
|
),
|
|
1776
|
-
fixHint: (0,
|
|
1835
|
+
fixHint: (0, import_i18n24.__)("Open Site Settings and customize your kit (colors, fonts, layout).", "elementor"),
|
|
1777
1836
|
categories: ["best-practices"],
|
|
1778
1837
|
severity: "info",
|
|
1779
1838
|
weight: 1,
|
|
@@ -1786,7 +1845,7 @@ var audit6 = {
|
|
|
1786
1845
|
violations: [
|
|
1787
1846
|
{
|
|
1788
1847
|
auditId: audit6.id,
|
|
1789
|
-
label: (0,
|
|
1848
|
+
label: (0, import_i18n24.__)("Kit appears unchanged from default.", "elementor"),
|
|
1790
1849
|
targetHint: "site-settings"
|
|
1791
1850
|
}
|
|
1792
1851
|
]
|
|
@@ -1796,16 +1855,16 @@ var audit6 = {
|
|
|
1796
1855
|
|
|
1797
1856
|
// src/audits/deprecated-widgets.ts
|
|
1798
1857
|
var import_editor_elements8 = require("@elementor/editor-elements");
|
|
1799
|
-
var
|
|
1858
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
1800
1859
|
var DEPRECATION_CONTROL_NAME = "deprecation_message";
|
|
1801
1860
|
var audit7 = {
|
|
1802
1861
|
id: "audits/deprecated-widgets",
|
|
1803
|
-
title: (0,
|
|
1804
|
-
description: (0,
|
|
1862
|
+
title: (0, import_i18n25.__)("Deprecated widgets", "elementor"),
|
|
1863
|
+
description: (0, import_i18n25.__)(
|
|
1805
1864
|
"Deprecated widgets should not be used. For better capabilities use the recommended replacement.",
|
|
1806
1865
|
"elementor"
|
|
1807
1866
|
),
|
|
1808
|
-
fixHint: (0,
|
|
1867
|
+
fixHint: (0, import_i18n25.__)("Replace each deprecated widget with the recommended new widget shown in its panel.", "elementor"),
|
|
1809
1868
|
categories: ["best-practices", "performance"],
|
|
1810
1869
|
severity: "warning",
|
|
1811
1870
|
weight: 7,
|
|
@@ -1832,7 +1891,7 @@ var audit7 = {
|
|
|
1832
1891
|
auditId: audit7.id,
|
|
1833
1892
|
elementId: node.id,
|
|
1834
1893
|
targetHint: "element-settings",
|
|
1835
|
-
label: (0,
|
|
1894
|
+
label: (0, import_i18n25.__)("Using deprecated widget.", "elementor")
|
|
1836
1895
|
});
|
|
1837
1896
|
});
|
|
1838
1897
|
return violations.length === 0 ? { status: "pass" } : { status: "fail", violations };
|
|
@@ -1840,7 +1899,7 @@ var audit7 = {
|
|
|
1840
1899
|
};
|
|
1841
1900
|
|
|
1842
1901
|
// src/audits/google-consent-mode.ts
|
|
1843
|
-
var
|
|
1902
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
1844
1903
|
|
|
1845
1904
|
// src/utils/scan-consent-signals.ts
|
|
1846
1905
|
var GOOGLE_TRACKING_PATTERNS = [
|
|
@@ -1863,12 +1922,12 @@ function hasConsentDefaultCall(html) {
|
|
|
1863
1922
|
// src/audits/google-consent-mode.ts
|
|
1864
1923
|
var audit8 = {
|
|
1865
1924
|
id: "audits/google-consent-mode",
|
|
1866
|
-
title: (0,
|
|
1867
|
-
description: (0,
|
|
1925
|
+
title: (0, import_i18n26.__)("Google Consent Mode", "elementor"),
|
|
1926
|
+
description: (0, import_i18n26.__)(
|
|
1868
1927
|
"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.",
|
|
1869
1928
|
"elementor"
|
|
1870
1929
|
),
|
|
1871
|
-
fixHint: (0,
|
|
1930
|
+
fixHint: (0, import_i18n26.__)(
|
|
1872
1931
|
"Turn on Google Consent Mode in your cookie consent plugin so Google tags respect visitor consent choices.",
|
|
1873
1932
|
"elementor"
|
|
1874
1933
|
),
|
|
@@ -1877,18 +1936,18 @@ var audit8 = {
|
|
|
1877
1936
|
weight: 1,
|
|
1878
1937
|
evaluate: (ctx) => {
|
|
1879
1938
|
if (!ctx.pageContext.frontend_url) {
|
|
1880
|
-
return { status: "skipped", reason: (0,
|
|
1939
|
+
return { status: "skipped", reason: (0, import_i18n26.__)("Page is not published.", "elementor") };
|
|
1881
1940
|
}
|
|
1882
1941
|
if (!ctx.renderedHtml) {
|
|
1883
|
-
return { status: "skipped", reason: (0,
|
|
1942
|
+
return { status: "skipped", reason: (0, import_i18n26.__)("Could not fetch the published page.", "elementor") };
|
|
1884
1943
|
}
|
|
1885
1944
|
if (!hasGoogleTracking(ctx.renderedHtml)) {
|
|
1886
|
-
return { status: "skipped", reason: (0,
|
|
1945
|
+
return { status: "skipped", reason: (0, import_i18n26.__)("No Google tracking product detected.", "elementor") };
|
|
1887
1946
|
}
|
|
1888
1947
|
if (hasConsentDefaultCall(ctx.renderedHtml)) {
|
|
1889
1948
|
return { status: "pass" };
|
|
1890
1949
|
}
|
|
1891
|
-
const label = (0,
|
|
1950
|
+
const label = (0, import_i18n26.__)("No Google Consent Mode signal was found on the page.", "elementor");
|
|
1892
1951
|
const isCookiezReady = ctx.pageContext.cookiez_plugin_installed && ctx.pageContext.cookiez_plugin_active;
|
|
1893
1952
|
if (isCookiezReady) {
|
|
1894
1953
|
return {
|
|
@@ -1897,7 +1956,7 @@ var audit8 = {
|
|
|
1897
1956
|
{
|
|
1898
1957
|
auditId: audit8.id,
|
|
1899
1958
|
label,
|
|
1900
|
-
ctaLabel: (0,
|
|
1959
|
+
ctaLabel: (0, import_i18n26.__)("Enable", "elementor"),
|
|
1901
1960
|
externalUrl: ctx.pageContext.cookiez_consent_mode_settings_url
|
|
1902
1961
|
}
|
|
1903
1962
|
]
|
|
@@ -1917,7 +1976,7 @@ var audit8 = {
|
|
|
1917
1976
|
};
|
|
1918
1977
|
|
|
1919
1978
|
// src/audits/heading-structure.ts
|
|
1920
|
-
var
|
|
1979
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
1921
1980
|
var HEADING_LEVELS = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
1922
1981
|
var HEADING_CONTROLS_REGISTRY = {
|
|
1923
1982
|
// Core
|
|
@@ -2095,27 +2154,27 @@ function extractPageHeadings(tree) {
|
|
|
2095
2154
|
}
|
|
2096
2155
|
var audit9 = {
|
|
2097
2156
|
id: "audits/heading-structure",
|
|
2098
|
-
title: (0,
|
|
2099
|
-
description: (0,
|
|
2100
|
-
fixHint: (0,
|
|
2157
|
+
title: (0, import_i18n27.__)("Heading structure", "elementor"),
|
|
2158
|
+
description: (0, import_i18n27.__)("Pages should have exactly one H1 and a non-skipping heading order.", "elementor"),
|
|
2159
|
+
fixHint: (0, import_i18n27.__)("Ensure your page has one H1 and that heading levels do not skip (no H2 \u2192 H4).", "elementor"),
|
|
2101
2160
|
categories: ["seo", "accessibility"],
|
|
2102
2161
|
severity: "error",
|
|
2103
2162
|
weight: 10,
|
|
2104
2163
|
evaluate: (ctx) => {
|
|
2105
2164
|
if (ctx.elements.tree.length === 0) {
|
|
2106
|
-
return { status: "skipped", reason: (0,
|
|
2165
|
+
return { status: "skipped", reason: (0, import_i18n27.__)("No elements", "elementor") };
|
|
2107
2166
|
}
|
|
2108
2167
|
const headings = extractPageHeadings(ctx.elements.tree);
|
|
2109
2168
|
const violations = [];
|
|
2110
2169
|
if (headings.length === 0) {
|
|
2111
2170
|
violations.push({
|
|
2112
2171
|
auditId: audit9.id,
|
|
2113
|
-
label: (0,
|
|
2172
|
+
label: (0, import_i18n27.__)("No headings found on the page.", "elementor")
|
|
2114
2173
|
});
|
|
2115
2174
|
} else {
|
|
2116
2175
|
const h1Count = headings.filter((h) => h.level === 1).length;
|
|
2117
2176
|
if (h1Count === 0) {
|
|
2118
|
-
violations.push({ auditId: audit9.id, label: (0,
|
|
2177
|
+
violations.push({ auditId: audit9.id, label: (0, import_i18n27.__)("No H1 on the page.", "elementor") });
|
|
2119
2178
|
}
|
|
2120
2179
|
if (h1Count > 1) {
|
|
2121
2180
|
headings.filter((h) => h.level === 1).slice(1).forEach(
|
|
@@ -2123,7 +2182,7 @@ var audit9 = {
|
|
|
2123
2182
|
auditId: audit9.id,
|
|
2124
2183
|
elementId: h.elementId,
|
|
2125
2184
|
targetHint: "element-settings",
|
|
2126
|
-
label: (0,
|
|
2185
|
+
label: (0, import_i18n27.__)("More than one H1 on the page.", "elementor")
|
|
2127
2186
|
})
|
|
2128
2187
|
);
|
|
2129
2188
|
}
|
|
@@ -2133,7 +2192,7 @@ var audit9 = {
|
|
|
2133
2192
|
auditId: audit9.id,
|
|
2134
2193
|
elementId: headings[i].elementId,
|
|
2135
2194
|
targetHint: "element-settings",
|
|
2136
|
-
label: (0,
|
|
2195
|
+
label: (0, import_i18n27.__)("Heading level skipped.", "elementor")
|
|
2137
2196
|
});
|
|
2138
2197
|
}
|
|
2139
2198
|
}
|
|
@@ -2143,24 +2202,24 @@ var audit9 = {
|
|
|
2143
2202
|
};
|
|
2144
2203
|
|
|
2145
2204
|
// src/audits/hidden-elements.ts
|
|
2146
|
-
var
|
|
2205
|
+
var import_i18n28 = require("@wordpress/i18n");
|
|
2147
2206
|
function isHiddenOnAllDevices(settings) {
|
|
2148
2207
|
return Boolean(settings.hide_desktop) && Boolean(settings.hide_tablet) && Boolean(settings.hide_mobile);
|
|
2149
2208
|
}
|
|
2150
2209
|
var audit10 = {
|
|
2151
2210
|
id: "audits/hidden-elements",
|
|
2152
|
-
title: (0,
|
|
2153
|
-
description: (0,
|
|
2211
|
+
title: (0, import_i18n28.__)("Hidden elements", "elementor"),
|
|
2212
|
+
description: (0, import_i18n28.__)(
|
|
2154
2213
|
"Elements hidden on all devices simultaneously are effectively dead code in the page tree.",
|
|
2155
2214
|
"elementor"
|
|
2156
2215
|
),
|
|
2157
|
-
fixHint: (0,
|
|
2216
|
+
fixHint: (0, import_i18n28.__)("Remove the element or make it visible on at least one device breakpoint.", "elementor"),
|
|
2158
2217
|
categories: ["best-practices", "performance"],
|
|
2159
2218
|
severity: "info",
|
|
2160
2219
|
weight: 3,
|
|
2161
2220
|
evaluate: (ctx) => {
|
|
2162
2221
|
if (ctx.elements.tree.length === 0) {
|
|
2163
|
-
return { status: "skipped", reason: (0,
|
|
2222
|
+
return { status: "skipped", reason: (0, import_i18n28.__)("No elements", "elementor") };
|
|
2164
2223
|
}
|
|
2165
2224
|
const violations = [];
|
|
2166
2225
|
walkElements(ctx.elements.tree, (node) => {
|
|
@@ -2169,7 +2228,7 @@ var audit10 = {
|
|
|
2169
2228
|
auditId: audit10.id,
|
|
2170
2229
|
elementId: node.id,
|
|
2171
2230
|
targetHint: "element-settings",
|
|
2172
|
-
label: (0,
|
|
2231
|
+
label: (0, import_i18n28.__)("Element is hidden on all devices.", "elementor")
|
|
2173
2232
|
});
|
|
2174
2233
|
}
|
|
2175
2234
|
});
|
|
@@ -2178,7 +2237,7 @@ var audit10 = {
|
|
|
2178
2237
|
};
|
|
2179
2238
|
|
|
2180
2239
|
// src/audits/images-alt-text.ts
|
|
2181
|
-
var
|
|
2240
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
2182
2241
|
|
|
2183
2242
|
// src/utils/image-alt.ts
|
|
2184
2243
|
function hasMeaningfulAlt(media, pageContext) {
|
|
@@ -2199,15 +2258,15 @@ function isImageSourcePresent(media) {
|
|
|
2199
2258
|
// src/audits/images-alt-text.ts
|
|
2200
2259
|
var audit11 = {
|
|
2201
2260
|
id: "audits/images-alt-text",
|
|
2202
|
-
title: (0,
|
|
2203
|
-
description: (0,
|
|
2204
|
-
fixHint: (0,
|
|
2261
|
+
title: (0, import_i18n29.__)("Images alt text", "elementor"),
|
|
2262
|
+
description: (0, import_i18n29.__)("Every image needs a meaningful alt attribute for screen readers and image-search.", "elementor"),
|
|
2263
|
+
fixHint: (0, import_i18n29.__)("Open the image's settings and add an Alt Text describing the image.", "elementor"),
|
|
2205
2264
|
categories: ["seo", "accessibility"],
|
|
2206
2265
|
severity: "error",
|
|
2207
2266
|
weight: 10,
|
|
2208
2267
|
evaluate: (ctx) => {
|
|
2209
2268
|
if (!hasPageImages(ctx.elements.tree)) {
|
|
2210
|
-
return { status: "skipped", reason: (0,
|
|
2269
|
+
return { status: "skipped", reason: (0, import_i18n29.__)("No images", "elementor") };
|
|
2211
2270
|
}
|
|
2212
2271
|
const violations = [];
|
|
2213
2272
|
const failedWidgetIds = /* @__PURE__ */ new Set();
|
|
@@ -2223,9 +2282,9 @@ var audit11 = {
|
|
|
2223
2282
|
auditId: audit11.id,
|
|
2224
2283
|
elementId: node.id,
|
|
2225
2284
|
targetHint: "element-settings",
|
|
2226
|
-
label: (0,
|
|
2285
|
+
label: (0, import_i18n29.__)("Image is missing alt text.", "elementor"),
|
|
2227
2286
|
externalUrl: ctx.pageContext.ally_plugin_url,
|
|
2228
|
-
ctaLabel: (0,
|
|
2287
|
+
ctaLabel: (0, import_i18n29.__)("Fix with Ally", "elementor")
|
|
2229
2288
|
});
|
|
2230
2289
|
}
|
|
2231
2290
|
});
|
|
@@ -2234,13 +2293,13 @@ var audit11 = {
|
|
|
2234
2293
|
};
|
|
2235
2294
|
|
|
2236
2295
|
// src/audits/images-inefficient-format.ts
|
|
2237
|
-
var
|
|
2296
|
+
var import_i18n30 = require("@wordpress/i18n");
|
|
2238
2297
|
var LEGACY_RASTER_MIME_TYPES = /* @__PURE__ */ new Set(["image/jpeg", "image/png", "image/gif", "image/bmp", "image/tiff"]);
|
|
2239
2298
|
var audit12 = {
|
|
2240
2299
|
id: "audits/images-inefficient-format",
|
|
2241
|
-
title: (0,
|
|
2242
|
-
description: (0,
|
|
2243
|
-
fixHint: (0,
|
|
2300
|
+
title: (0, import_i18n30.__)("Inefficient image format", "elementor"),
|
|
2301
|
+
description: (0, import_i18n30.__)("Image isn't served in a modern, efficient format like WebP or AVIF.", "elementor"),
|
|
2302
|
+
fixHint: (0, import_i18n30.__)("Convert the image to a modern format like WebP or AVIF, or enable image optimization.", "elementor"),
|
|
2244
2303
|
categories: ["performance"],
|
|
2245
2304
|
severity: "info",
|
|
2246
2305
|
weight: 1,
|
|
@@ -2268,29 +2327,29 @@ var audit12 = {
|
|
|
2268
2327
|
walkAtomicImageSources(ctx.elements.tree, ({ node, media }) => evaluateSource(node, media));
|
|
2269
2328
|
walkAtomicBackgroundImageSources(ctx.elements.tree, ({ node, media }) => evaluateSource(node, media));
|
|
2270
2329
|
if (!hasAnyImage) {
|
|
2271
|
-
return { status: "skipped", reason: (0,
|
|
2330
|
+
return { status: "skipped", reason: (0, import_i18n30.__)("No images", "elementor") };
|
|
2272
2331
|
}
|
|
2273
2332
|
const violations = Array.from(offendingElementIds).map((elementId) => ({
|
|
2274
2333
|
auditId: audit12.id,
|
|
2275
2334
|
elementId,
|
|
2276
2335
|
targetHint: "element-settings",
|
|
2277
|
-
label: (0,
|
|
2336
|
+
label: (0, import_i18n30.__)("Image isn't served in a modern format like WebP or AVIF.", "elementor"),
|
|
2278
2337
|
externalUrl: ctx.pageContext.image_optimization_plugin_url,
|
|
2279
|
-
ctaLabel: (0,
|
|
2338
|
+
ctaLabel: (0, import_i18n30.__)("Optimize all", "elementor")
|
|
2280
2339
|
}));
|
|
2281
2340
|
return violations.length === 0 ? { status: "pass" } : { status: "fail", violations, metadata: { inefficientImageFormatCount } };
|
|
2282
2341
|
}
|
|
2283
2342
|
};
|
|
2284
2343
|
|
|
2285
2344
|
// src/audits/images-too-large.ts
|
|
2286
|
-
var
|
|
2345
|
+
var import_i18n31 = require("@wordpress/i18n");
|
|
2287
2346
|
var SIZE_THRESHOLD_BYTES = 500 * 1024;
|
|
2288
2347
|
var BYTES_PER_KB = 1024;
|
|
2289
2348
|
var audit13 = {
|
|
2290
2349
|
id: "audits/images-too-large",
|
|
2291
|
-
title: (0,
|
|
2292
|
-
description: (0,
|
|
2293
|
-
fixHint: (0,
|
|
2350
|
+
title: (0, import_i18n31.__)("Oversized images", "elementor"),
|
|
2351
|
+
description: (0, import_i18n31.__)("Large image files slow down the page.", "elementor"),
|
|
2352
|
+
fixHint: (0, import_i18n31.__)("Replace the image with a smaller version or enable image optimization.", "elementor"),
|
|
2294
2353
|
categories: ["performance"],
|
|
2295
2354
|
severity: "warning",
|
|
2296
2355
|
weight: 7,
|
|
@@ -2320,40 +2379,40 @@ var audit13 = {
|
|
|
2320
2379
|
walkAtomicImageSources(ctx.elements.tree, ({ node, media }) => evaluateSource(node, media));
|
|
2321
2380
|
walkAtomicBackgroundImageSources(ctx.elements.tree, ({ node, media }) => evaluateSource(node, media));
|
|
2322
2381
|
if (!hasAnyImage) {
|
|
2323
|
-
return { status: "skipped", reason: (0,
|
|
2382
|
+
return { status: "skipped", reason: (0, import_i18n31.__)("No images", "elementor") };
|
|
2324
2383
|
}
|
|
2325
2384
|
const violations = Array.from(widgetMaxKb.entries()).map(([elementId, kb]) => ({
|
|
2326
2385
|
auditId: audit13.id,
|
|
2327
2386
|
elementId,
|
|
2328
2387
|
targetHint: "element-settings",
|
|
2329
|
-
label: (0,
|
|
2388
|
+
label: (0, import_i18n31.sprintf)(
|
|
2330
2389
|
/* translators: %d is the image file size in kilobytes. */
|
|
2331
|
-
(0,
|
|
2390
|
+
(0, import_i18n31.__)("Image is %d KB (over 500 KB).", "elementor"),
|
|
2332
2391
|
kb
|
|
2333
2392
|
),
|
|
2334
2393
|
externalUrl: ctx.pageContext.image_optimization_plugin_url,
|
|
2335
|
-
ctaLabel: (0,
|
|
2394
|
+
ctaLabel: (0, import_i18n31.__)("Optimize all", "elementor")
|
|
2336
2395
|
}));
|
|
2337
2396
|
return violations.length === 0 ? { status: "pass" } : { status: "fail", violations, metadata: { oversizedImageCount } };
|
|
2338
2397
|
}
|
|
2339
2398
|
};
|
|
2340
2399
|
|
|
2341
2400
|
// src/audits/nested-boxed-containers.ts
|
|
2342
|
-
var
|
|
2401
|
+
var import_i18n32 = require("@wordpress/i18n");
|
|
2343
2402
|
function isBoxed(settings) {
|
|
2344
2403
|
return settings.content_width === "boxed";
|
|
2345
2404
|
}
|
|
2346
2405
|
var audit14 = {
|
|
2347
2406
|
id: "audits/nested-boxed-containers",
|
|
2348
|
-
title: (0,
|
|
2349
|
-
description: (0,
|
|
2350
|
-
fixHint: (0,
|
|
2407
|
+
title: (0, import_i18n32.__)("Boxed container nested inside a boxed parent", "elementor"),
|
|
2408
|
+
description: (0, import_i18n32.__)("An inner container does not need to be boxed when its parent already is.", "elementor"),
|
|
2409
|
+
fixHint: (0, import_i18n32.__)("Change the inner container's content width to Full Width.", "elementor"),
|
|
2351
2410
|
categories: ["best-practices", "performance"],
|
|
2352
2411
|
severity: "info",
|
|
2353
2412
|
weight: 5,
|
|
2354
2413
|
evaluate: (ctx) => {
|
|
2355
2414
|
if (ctx.elements.tree.length === 0) {
|
|
2356
|
-
return { status: "skipped", reason: (0,
|
|
2415
|
+
return { status: "skipped", reason: (0, import_i18n32.__)("No elements", "elementor") };
|
|
2357
2416
|
}
|
|
2358
2417
|
const violations = [];
|
|
2359
2418
|
walkElements(ctx.elements.tree, (node, parents) => {
|
|
@@ -2366,7 +2425,7 @@ var audit14 = {
|
|
|
2366
2425
|
auditId: audit14.id,
|
|
2367
2426
|
elementId: node.id,
|
|
2368
2427
|
targetHint: "element-settings",
|
|
2369
|
-
label: (0,
|
|
2428
|
+
label: (0, import_i18n32.__)("Nested boxed container.", "elementor")
|
|
2370
2429
|
});
|
|
2371
2430
|
}
|
|
2372
2431
|
});
|
|
@@ -2375,12 +2434,12 @@ var audit14 = {
|
|
|
2375
2434
|
};
|
|
2376
2435
|
|
|
2377
2436
|
// src/audits/page-excerpt.ts
|
|
2378
|
-
var
|
|
2437
|
+
var import_i18n33 = require("@wordpress/i18n");
|
|
2379
2438
|
var audit15 = {
|
|
2380
2439
|
id: "audits/page-excerpt",
|
|
2381
|
-
title: (0,
|
|
2382
|
-
description: (0,
|
|
2383
|
-
fixHint: (0,
|
|
2440
|
+
title: (0, import_i18n33.__)("Page excerpt", "elementor"),
|
|
2441
|
+
description: (0, import_i18n33.__)("A descriptive excerpt helps search engines and previews summarize the page.", "elementor"),
|
|
2442
|
+
fixHint: (0, import_i18n33.__)("Open Page Settings and write a short excerpt.", "elementor"),
|
|
2384
2443
|
categories: ["seo"],
|
|
2385
2444
|
severity: "warning",
|
|
2386
2445
|
weight: 5,
|
|
@@ -2393,7 +2452,7 @@ var audit15 = {
|
|
|
2393
2452
|
violations: [
|
|
2394
2453
|
{
|
|
2395
2454
|
auditId: audit15.id,
|
|
2396
|
-
label: (0,
|
|
2455
|
+
label: (0, import_i18n33.__)("Page has no excerpt.", "elementor"),
|
|
2397
2456
|
targetHint: "page-settings",
|
|
2398
2457
|
angieFix: true
|
|
2399
2458
|
}
|
|
@@ -2403,12 +2462,12 @@ var audit15 = {
|
|
|
2403
2462
|
};
|
|
2404
2463
|
|
|
2405
2464
|
// src/audits/page-featured-image.ts
|
|
2406
|
-
var
|
|
2465
|
+
var import_i18n34 = require("@wordpress/i18n");
|
|
2407
2466
|
var audit16 = {
|
|
2408
2467
|
id: "audits/page-featured-image",
|
|
2409
|
-
title: (0,
|
|
2410
|
-
description: (0,
|
|
2411
|
-
fixHint: (0,
|
|
2468
|
+
title: (0, import_i18n34.__)("Page featured image", "elementor"),
|
|
2469
|
+
description: (0, import_i18n34.__)("Featured images are used by social shares and many themes for hero visuals.", "elementor"),
|
|
2470
|
+
fixHint: (0, import_i18n34.__)("Open Page Settings and set a featured image.", "elementor"),
|
|
2412
2471
|
categories: ["seo"],
|
|
2413
2472
|
severity: "info",
|
|
2414
2473
|
weight: 5,
|
|
@@ -2421,7 +2480,7 @@ var audit16 = {
|
|
|
2421
2480
|
violations: [
|
|
2422
2481
|
{
|
|
2423
2482
|
auditId: audit16.id,
|
|
2424
|
-
label: (0,
|
|
2483
|
+
label: (0, import_i18n34.__)("No featured image set.", "elementor"),
|
|
2425
2484
|
targetHint: "page-settings"
|
|
2426
2485
|
}
|
|
2427
2486
|
]
|
|
@@ -2430,13 +2489,13 @@ var audit16 = {
|
|
|
2430
2489
|
};
|
|
2431
2490
|
|
|
2432
2491
|
// src/audits/page-title.ts
|
|
2433
|
-
var
|
|
2492
|
+
var import_i18n35 = require("@wordpress/i18n");
|
|
2434
2493
|
var MAX_TITLE_LENGTH = 60;
|
|
2435
2494
|
var audit17 = {
|
|
2436
2495
|
id: "audits/page-title",
|
|
2437
|
-
title: (0,
|
|
2438
|
-
description: (0,
|
|
2439
|
-
fixHint: (0,
|
|
2496
|
+
title: (0, import_i18n35.__)("Page title", "elementor"),
|
|
2497
|
+
description: (0, import_i18n35.__)("Pages need a clear title for SEO and screen-reader navigation.", "elementor"),
|
|
2498
|
+
fixHint: (0, import_i18n35.__)("Open Page Settings and add a title.", "elementor"),
|
|
2440
2499
|
categories: ["seo"],
|
|
2441
2500
|
severity: "error",
|
|
2442
2501
|
weight: 10,
|
|
@@ -2448,10 +2507,10 @@ var audit17 = {
|
|
|
2448
2507
|
violations: [
|
|
2449
2508
|
{
|
|
2450
2509
|
auditId: audit17.id,
|
|
2451
|
-
label: (0,
|
|
2510
|
+
label: (0, import_i18n35.__)("Page has no title.", "elementor"),
|
|
2452
2511
|
targetHint: "page-settings",
|
|
2453
2512
|
angieFix: true,
|
|
2454
|
-
angiePrompt: (0,
|
|
2513
|
+
angiePrompt: (0, import_i18n35.__)(
|
|
2455
2514
|
"Based on this page's contents, generate a title for this page.",
|
|
2456
2515
|
"elementor"
|
|
2457
2516
|
)
|
|
@@ -2465,7 +2524,7 @@ var audit17 = {
|
|
|
2465
2524
|
violations: [
|
|
2466
2525
|
{
|
|
2467
2526
|
auditId: audit17.id,
|
|
2468
|
-
label: (0,
|
|
2527
|
+
label: (0, import_i18n35.__)("Page title is too long.", "elementor"),
|
|
2469
2528
|
targetHint: "page-settings",
|
|
2470
2529
|
angieFix: true
|
|
2471
2530
|
}
|
|
@@ -2477,7 +2536,7 @@ var audit17 = {
|
|
|
2477
2536
|
};
|
|
2478
2537
|
|
|
2479
2538
|
// src/audits/prefer-global-colors.ts
|
|
2480
|
-
var
|
|
2539
|
+
var import_i18n36 = require("@wordpress/i18n");
|
|
2481
2540
|
|
|
2482
2541
|
// src/utils/collect-hardcoded-colors.ts
|
|
2483
2542
|
var RESERVED_SETTING_KEYS = /* @__PURE__ */ new Set(["__globals__", "__dynamic__"]);
|
|
@@ -2545,18 +2604,18 @@ function findMatchingGlobalByValue(value, globals) {
|
|
|
2545
2604
|
// src/audits/prefer-global-colors.ts
|
|
2546
2605
|
var audit18 = {
|
|
2547
2606
|
id: "audits/prefer-global-colors",
|
|
2548
|
-
title: (0,
|
|
2549
|
-
description: (0,
|
|
2550
|
-
fixHint: (0,
|
|
2607
|
+
title: (0, import_i18n36.__)("Prefer global colors", "elementor"),
|
|
2608
|
+
description: (0, import_i18n36.__)("Global colors make the design consistent and easy to update site-wide.", "elementor"),
|
|
2609
|
+
fixHint: (0, import_i18n36.__)("Replace the hard-coded value with the matching global color.", "elementor"),
|
|
2551
2610
|
categories: ["best-practices"],
|
|
2552
2611
|
severity: "info",
|
|
2553
2612
|
weight: 3,
|
|
2554
2613
|
evaluate: (ctx) => {
|
|
2555
2614
|
if (ctx.elements.tree.length === 0) {
|
|
2556
|
-
return { status: "skipped", reason: (0,
|
|
2615
|
+
return { status: "skipped", reason: (0, import_i18n36.__)("No elements", "elementor") };
|
|
2557
2616
|
}
|
|
2558
2617
|
if (ctx.kit.globals.colors.length === 0) {
|
|
2559
|
-
return { status: "skipped", reason: (0,
|
|
2618
|
+
return { status: "skipped", reason: (0, import_i18n36.__)("No global colors", "elementor") };
|
|
2560
2619
|
}
|
|
2561
2620
|
const violations = [];
|
|
2562
2621
|
walkElements(ctx.elements.tree, (node) => {
|
|
@@ -2570,9 +2629,9 @@ var audit18 = {
|
|
|
2570
2629
|
elementId: node.id,
|
|
2571
2630
|
targetHint: "element-settings",
|
|
2572
2631
|
angieFix: true,
|
|
2573
|
-
label: (0,
|
|
2632
|
+
label: (0, import_i18n36.sprintf)(
|
|
2574
2633
|
/* translators: 1: hard-coded color value, 2: global color title. */
|
|
2575
|
-
(0,
|
|
2634
|
+
(0, import_i18n36.__)('replace "%1$s" with "%2$s" global color', "elementor"),
|
|
2576
2635
|
value,
|
|
2577
2636
|
global.title
|
|
2578
2637
|
)
|
|
@@ -2584,7 +2643,7 @@ var audit18 = {
|
|
|
2584
2643
|
};
|
|
2585
2644
|
|
|
2586
2645
|
// src/audits/prefer-global-fonts.ts
|
|
2587
|
-
var
|
|
2646
|
+
var import_i18n37 = require("@wordpress/i18n");
|
|
2588
2647
|
|
|
2589
2648
|
// src/utils/collect-hardcoded-fonts.ts
|
|
2590
2649
|
var RESERVED_SETTING_KEYS2 = /* @__PURE__ */ new Set(["__globals__", "__dynamic__"]);
|
|
@@ -2644,18 +2703,18 @@ function collectHardcodedFonts(settings, pathPrefix = "") {
|
|
|
2644
2703
|
// src/audits/prefer-global-fonts.ts
|
|
2645
2704
|
var audit19 = {
|
|
2646
2705
|
id: "audits/prefer-global-fonts",
|
|
2647
|
-
title: (0,
|
|
2648
|
-
description: (0,
|
|
2649
|
-
fixHint: (0,
|
|
2706
|
+
title: (0, import_i18n37.__)("Prefer global fonts", "elementor"),
|
|
2707
|
+
description: (0, import_i18n37.__)("Global fonts make the design consistent and easy to update site-wide.", "elementor"),
|
|
2708
|
+
fixHint: (0, import_i18n37.__)("Replace the hard-coded value with the matching global font.", "elementor"),
|
|
2650
2709
|
categories: ["best-practices", "performance"],
|
|
2651
2710
|
severity: "info",
|
|
2652
2711
|
weight: 3,
|
|
2653
2712
|
evaluate: (ctx) => {
|
|
2654
2713
|
if (ctx.elements.tree.length === 0) {
|
|
2655
|
-
return { status: "skipped", reason: (0,
|
|
2714
|
+
return { status: "skipped", reason: (0, import_i18n37.__)("No elements", "elementor") };
|
|
2656
2715
|
}
|
|
2657
2716
|
if (ctx.kit.globals.fonts.length === 0) {
|
|
2658
|
-
return { status: "skipped", reason: (0,
|
|
2717
|
+
return { status: "skipped", reason: (0, import_i18n37.__)("No global fonts", "elementor") };
|
|
2659
2718
|
}
|
|
2660
2719
|
const violations = [];
|
|
2661
2720
|
walkElements(ctx.elements.tree, (node) => {
|
|
@@ -2668,9 +2727,9 @@ var audit19 = {
|
|
|
2668
2727
|
auditId: audit19.id,
|
|
2669
2728
|
elementId: node.id,
|
|
2670
2729
|
targetHint: "element-settings",
|
|
2671
|
-
label: (0,
|
|
2730
|
+
label: (0, import_i18n37.sprintf)(
|
|
2672
2731
|
/* translators: %s: global font title. */
|
|
2673
|
-
(0,
|
|
2732
|
+
(0, import_i18n37.__)('replace hardcoded typography with "%s" global font', "elementor"),
|
|
2674
2733
|
global.title
|
|
2675
2734
|
)
|
|
2676
2735
|
});
|
|
@@ -2681,15 +2740,15 @@ var audit19 = {
|
|
|
2681
2740
|
};
|
|
2682
2741
|
|
|
2683
2742
|
// src/audits/privacy-policy.ts
|
|
2684
|
-
var
|
|
2743
|
+
var import_i18n38 = require("@wordpress/i18n");
|
|
2685
2744
|
var audit20 = {
|
|
2686
2745
|
id: "audits/privacy-policy",
|
|
2687
|
-
title: (0,
|
|
2688
|
-
description: (0,
|
|
2746
|
+
title: (0, import_i18n38.__)("Privacy policy", "elementor"),
|
|
2747
|
+
description: (0, import_i18n38.__)(
|
|
2689
2748
|
"A privacy policy page is required by privacy regulations such as GDPR (EU) and CCPA (US).",
|
|
2690
2749
|
"elementor"
|
|
2691
2750
|
),
|
|
2692
|
-
fixHint: (0,
|
|
2751
|
+
fixHint: (0, import_i18n38.__)(
|
|
2693
2752
|
"Go to Settings > Privacy in the WordPress admin and assign a published privacy policy page.",
|
|
2694
2753
|
"elementor"
|
|
2695
2754
|
),
|
|
@@ -2705,9 +2764,9 @@ var audit20 = {
|
|
|
2705
2764
|
violations: [
|
|
2706
2765
|
{
|
|
2707
2766
|
auditId: audit20.id,
|
|
2708
|
-
label: (0,
|
|
2767
|
+
label: (0, import_i18n38.__)("No privacy policy page is set.", "elementor"),
|
|
2709
2768
|
externalUrl: ctx.pageContext.privacy_settings_url,
|
|
2710
|
-
ctaLabel: (0,
|
|
2769
|
+
ctaLabel: (0, import_i18n38.__)("Create", "elementor")
|
|
2711
2770
|
}
|
|
2712
2771
|
]
|
|
2713
2772
|
};
|
|
@@ -2715,15 +2774,15 @@ var audit20 = {
|
|
|
2715
2774
|
};
|
|
2716
2775
|
|
|
2717
2776
|
// src/audits/robots-noindex.ts
|
|
2718
|
-
var
|
|
2777
|
+
var import_i18n39 = require("@wordpress/i18n");
|
|
2719
2778
|
var audit21 = {
|
|
2720
2779
|
id: "audits/robots-noindex",
|
|
2721
|
-
title: (0,
|
|
2722
|
-
description: (0,
|
|
2780
|
+
title: (0, import_i18n39.__)("Search engine visibility", "elementor"),
|
|
2781
|
+
description: (0, import_i18n39.__)(
|
|
2723
2782
|
"When search engine visibility is checked in WordPress Settings -> Reading -> Search Engine Visibility, search engines are discouraged from indexing the website.",
|
|
2724
2783
|
"elementor"
|
|
2725
2784
|
),
|
|
2726
|
-
fixHint: (0,
|
|
2785
|
+
fixHint: (0, import_i18n39.__)(
|
|
2727
2786
|
'Go to Settings \u2192 Reading in the WordPress admin and uncheck "Discourage search engines from indexing this site" when the website should be indexed.',
|
|
2728
2787
|
"elementor"
|
|
2729
2788
|
),
|
|
@@ -2739,7 +2798,7 @@ var audit21 = {
|
|
|
2739
2798
|
violations: [
|
|
2740
2799
|
{
|
|
2741
2800
|
auditId: audit21.id,
|
|
2742
|
-
label: (0,
|
|
2801
|
+
label: (0, import_i18n39.__)("Search engines are discouraged from indexing this website.", "elementor"),
|
|
2743
2802
|
externalUrl: ctx.pageContext.reading_settings_url
|
|
2744
2803
|
}
|
|
2745
2804
|
]
|
|
@@ -2748,15 +2807,15 @@ var audit21 = {
|
|
|
2748
2807
|
};
|
|
2749
2808
|
|
|
2750
2809
|
// src/audits/scan-for-cookies.ts
|
|
2751
|
-
var
|
|
2810
|
+
var import_i18n40 = require("@wordpress/i18n");
|
|
2752
2811
|
var audit22 = {
|
|
2753
2812
|
id: "audits/scan-for-cookies",
|
|
2754
|
-
title: (0,
|
|
2755
|
-
description: (0,
|
|
2813
|
+
title: (0, import_i18n40.__)("Scan for cookies", "elementor"),
|
|
2814
|
+
description: (0, import_i18n40.__)(
|
|
2756
2815
|
"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.",
|
|
2757
2816
|
"elementor"
|
|
2758
2817
|
),
|
|
2759
|
-
fixHint: (0,
|
|
2818
|
+
fixHint: (0, import_i18n40.__)("Run a Cookiez scan on this page to see which cookies need disclosure.", "elementor"),
|
|
2760
2819
|
categories: ["compliance"],
|
|
2761
2820
|
severity: "info",
|
|
2762
2821
|
weight: 0,
|
|
@@ -2767,7 +2826,7 @@ var audit22 = {
|
|
|
2767
2826
|
violations: [
|
|
2768
2827
|
{
|
|
2769
2828
|
auditId: audit22.id,
|
|
2770
|
-
label: (0,
|
|
2829
|
+
label: (0, import_i18n40.__)("This page has not been scanned for cookies yet.", "elementor"),
|
|
2771
2830
|
externalUrl: isReady ? ctx.pageContext.cookiez_scan_url : ctx.pageContext.cookiez_plugin_action_url
|
|
2772
2831
|
}
|
|
2773
2832
|
]
|
|
@@ -2776,21 +2835,21 @@ var audit22 = {
|
|
|
2776
2835
|
};
|
|
2777
2836
|
|
|
2778
2837
|
// src/audits/sections-and-columns.ts
|
|
2779
|
-
var
|
|
2838
|
+
var import_i18n41 = require("@wordpress/i18n");
|
|
2780
2839
|
var audit23 = {
|
|
2781
2840
|
id: "audits/sections-and-columns",
|
|
2782
|
-
title: (0,
|
|
2783
|
-
description: (0,
|
|
2841
|
+
title: (0, import_i18n41.__)("Sections and columns", "elementor"),
|
|
2842
|
+
description: (0, import_i18n41.__)(
|
|
2784
2843
|
"Sections and columns are legacy elements. Containers render fewer DOM nodes and are more flexible.",
|
|
2785
2844
|
"elementor"
|
|
2786
2845
|
),
|
|
2787
|
-
fixHint: (0,
|
|
2846
|
+
fixHint: (0, import_i18n41.__)("Use the Container Converter to replace each section/column with a container.", "elementor"),
|
|
2788
2847
|
categories: ["best-practices", "performance"],
|
|
2789
2848
|
severity: "warning",
|
|
2790
2849
|
weight: 7,
|
|
2791
2850
|
evaluate: (ctx) => {
|
|
2792
2851
|
if (ctx.elements.tree.length === 0) {
|
|
2793
|
-
return { status: "skipped", reason: (0,
|
|
2852
|
+
return { status: "skipped", reason: (0, import_i18n41.__)("No elements", "elementor") };
|
|
2794
2853
|
}
|
|
2795
2854
|
const violations = [];
|
|
2796
2855
|
walkElements(ctx.elements.tree, (node) => {
|
|
@@ -2798,7 +2857,7 @@ var audit23 = {
|
|
|
2798
2857
|
violations.push({
|
|
2799
2858
|
auditId: audit23.id,
|
|
2800
2859
|
elementId: node.id,
|
|
2801
|
-
label: node.elType === "section" ? (0,
|
|
2860
|
+
label: node.elType === "section" ? (0, import_i18n41.__)("Section element", "elementor") : (0, import_i18n41.__)("Column element", "elementor")
|
|
2802
2861
|
});
|
|
2803
2862
|
}
|
|
2804
2863
|
});
|
|
@@ -2807,15 +2866,15 @@ var audit23 = {
|
|
|
2807
2866
|
};
|
|
2808
2867
|
|
|
2809
2868
|
// src/audits/site-identity.ts
|
|
2810
|
-
var
|
|
2869
|
+
var import_i18n42 = require("@wordpress/i18n");
|
|
2811
2870
|
var audit24 = {
|
|
2812
2871
|
id: "audits/site-identity",
|
|
2813
|
-
title: (0,
|
|
2814
|
-
description: (0,
|
|
2872
|
+
title: (0, import_i18n42.__)("Site identity", "elementor"),
|
|
2873
|
+
description: (0, import_i18n42.__)(
|
|
2815
2874
|
"Site name, description, logo, and favicon establish your brand and appear in search results and browser tabs.",
|
|
2816
2875
|
"elementor"
|
|
2817
2876
|
),
|
|
2818
|
-
fixHint: (0,
|
|
2877
|
+
fixHint: (0, import_i18n42.__)("Open Site Settings \u2192 Site Identity and complete all the missing fields.", "elementor"),
|
|
2819
2878
|
categories: ["best-practices", "seo"],
|
|
2820
2879
|
severity: "info",
|
|
2821
2880
|
weight: 7,
|
|
@@ -2825,14 +2884,14 @@ var audit24 = {
|
|
|
2825
2884
|
if (!identity.site_name_set) {
|
|
2826
2885
|
violations.push({
|
|
2827
2886
|
auditId: audit24.id,
|
|
2828
|
-
label: (0,
|
|
2887
|
+
label: (0, import_i18n42.__)("Site name is missing or still uses the default.", "elementor"),
|
|
2829
2888
|
targetHint: "site-identity-settings"
|
|
2830
2889
|
});
|
|
2831
2890
|
}
|
|
2832
2891
|
if (!identity.site_description_set) {
|
|
2833
2892
|
violations.push({
|
|
2834
2893
|
auditId: audit24.id,
|
|
2835
|
-
label: (0,
|
|
2894
|
+
label: (0, import_i18n42.__)("Site description is missing or still uses the default.", "elementor"),
|
|
2836
2895
|
targetHint: "site-identity-settings",
|
|
2837
2896
|
angieFix: true
|
|
2838
2897
|
});
|
|
@@ -2840,14 +2899,14 @@ var audit24 = {
|
|
|
2840
2899
|
if (!identity.site_logo_set) {
|
|
2841
2900
|
violations.push({
|
|
2842
2901
|
auditId: audit24.id,
|
|
2843
|
-
label: (0,
|
|
2902
|
+
label: (0, import_i18n42.__)("Site logo is not set.", "elementor"),
|
|
2844
2903
|
targetHint: "site-identity-settings"
|
|
2845
2904
|
});
|
|
2846
2905
|
}
|
|
2847
2906
|
if (!identity.site_favicon_set) {
|
|
2848
2907
|
violations.push({
|
|
2849
2908
|
auditId: audit24.id,
|
|
2850
|
-
label: (0,
|
|
2909
|
+
label: (0, import_i18n42.__)("Site favicon is not set.", "elementor"),
|
|
2851
2910
|
targetHint: "site-identity-settings"
|
|
2852
2911
|
});
|
|
2853
2912
|
}
|
|
@@ -2863,7 +2922,7 @@ var audit24 = {
|
|
|
2863
2922
|
|
|
2864
2923
|
// src/audits/too-many-widgets.ts
|
|
2865
2924
|
var import_editor_elements9 = require("@elementor/editor-elements");
|
|
2866
|
-
var
|
|
2925
|
+
var import_i18n43 = require("@wordpress/i18n");
|
|
2867
2926
|
var WIDGET_COUNT_THRESHOLD = 100;
|
|
2868
2927
|
function isCountableWidget(node, widgetsCache) {
|
|
2869
2928
|
if (node.elType === "widget") {
|
|
@@ -2873,15 +2932,15 @@ function isCountableWidget(node, widgetsCache) {
|
|
|
2873
2932
|
}
|
|
2874
2933
|
var audit25 = {
|
|
2875
2934
|
id: "audits/too-many-widgets",
|
|
2876
|
-
title: (0,
|
|
2877
|
-
description: (0,
|
|
2878
|
-
fixHint: (0,
|
|
2935
|
+
title: (0, import_i18n43.__)("Too many widgets", "elementor"),
|
|
2936
|
+
description: (0, import_i18n43.__)("Excessive DOM size caused by too many widgets degrades rendering performance.", "elementor"),
|
|
2937
|
+
fixHint: (0, import_i18n43.__)("Reduce the number of widgets on the page by removing or combining elements.", "elementor"),
|
|
2879
2938
|
categories: ["best-practices", "performance"],
|
|
2880
2939
|
severity: "warning",
|
|
2881
2940
|
weight: 5,
|
|
2882
2941
|
evaluate: (ctx) => {
|
|
2883
2942
|
if (ctx.elements.tree.length === 0) {
|
|
2884
|
-
return { status: "skipped", reason: (0,
|
|
2943
|
+
return { status: "skipped", reason: (0, import_i18n43.__)("No elements", "elementor") };
|
|
2885
2944
|
}
|
|
2886
2945
|
const widgetsCache = (0, import_editor_elements9.getWidgetsCache)();
|
|
2887
2946
|
let widgetCount = 0;
|
|
@@ -2898,7 +2957,7 @@ var audit25 = {
|
|
|
2898
2957
|
violations: [
|
|
2899
2958
|
{
|
|
2900
2959
|
auditId: audit25.id,
|
|
2901
|
-
label: (0,
|
|
2960
|
+
label: (0, import_i18n43.__)("Page has too many widgets.", "elementor")
|
|
2902
2961
|
}
|
|
2903
2962
|
]
|
|
2904
2963
|
};
|
|
@@ -2939,12 +2998,25 @@ function registerAllAudits() {
|
|
|
2939
2998
|
}
|
|
2940
2999
|
}
|
|
2941
3000
|
|
|
3001
|
+
// src/sync-report-staleness.ts
|
|
3002
|
+
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
3003
|
+
var import_store6 = require("@elementor/store");
|
|
3004
|
+
function syncReportStaleness() {
|
|
3005
|
+
(0, import_editor_v1_adapters3.__privateListenTo)((0, import_editor_v1_adapters3.commandEndEvent)("document/save/set-is-modified"), (e) => {
|
|
3006
|
+
const event = e;
|
|
3007
|
+
if (event.args?.status) {
|
|
3008
|
+
(0, import_store6.__dispatch)(slice.actions.reportStale());
|
|
3009
|
+
}
|
|
3010
|
+
});
|
|
3011
|
+
}
|
|
3012
|
+
|
|
2942
3013
|
// src/init.ts
|
|
2943
3014
|
function init() {
|
|
2944
|
-
(0,
|
|
3015
|
+
(0, import_store7.__registerSlice)(slice);
|
|
2945
3016
|
registerAllAudits();
|
|
2946
|
-
(0,
|
|
3017
|
+
(0, import_editor_floating_panels6.registerFloatingPanel)(auditPanel.panel);
|
|
2947
3018
|
registerAppBarAuditsToggle();
|
|
3019
|
+
syncReportStaleness();
|
|
2948
3020
|
}
|
|
2949
3021
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2950
3022
|
0 && (module.exports = {
|