@elementor/editor-audits 4.3.0 → 4.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-audits",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,19 +39,19 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.3.0",
43
- "@elementor/editor-mcp": "4.3.0",
44
- "@elementor/editor-app-bar": "4.3.0",
45
- "@elementor/editor-elements": "4.3.0",
46
- "@elementor/editor-floating-panels": "4.3.0",
47
- "@elementor/editor-notifications": "4.3.0",
48
- "@elementor/editor-v1-adapters": "4.3.0",
49
- "@elementor/events": "4.3.0",
50
- "@elementor/http-client": "4.3.0",
42
+ "@elementor/editor": "4.3.1",
43
+ "@elementor/editor-mcp": "4.3.1",
44
+ "@elementor/editor-app-bar": "4.3.1",
45
+ "@elementor/editor-elements": "4.3.1",
46
+ "@elementor/editor-floating-panels": "4.3.1",
47
+ "@elementor/editor-notifications": "4.3.1",
48
+ "@elementor/editor-v1-adapters": "4.3.1",
49
+ "@elementor/events": "4.3.1",
50
+ "@elementor/http-client": "4.3.1",
51
51
  "@elementor/icons": "~1.77.0",
52
- "@elementor/locations": "4.3.0",
53
- "@elementor/session": "4.3.0",
54
- "@elementor/store": "4.3.0",
52
+ "@elementor/locations": "4.3.1",
53
+ "@elementor/session": "4.3.1",
54
+ "@elementor/store": "4.3.1",
55
55
  "@elementor/ui": "1.37.5"
56
56
  },
57
57
  "peerDependencies": {
@@ -1,10 +1,19 @@
1
+ import { getWidgetsCache } from '@elementor/editor-elements';
1
2
  import { __ } from '@wordpress/i18n';
2
3
 
3
- import { type Audit, type AuditViolation } from '../types';
4
+ import { type Audit, type AuditViolation, type ElementSnapshotNode } from '../types';
4
5
  import { walkElements } from '../utils/walk';
5
6
 
6
7
  const MAX_NESTING_DEPTH = 6;
7
8
 
9
+ function isNestingElement( node: ElementSnapshotNode, widgetsCache: ReturnType< typeof getWidgetsCache > ): boolean {
10
+ if ( node.elType === 'container' ) {
11
+ return true;
12
+ }
13
+
14
+ return !! widgetsCache?.[ node.elType ]?.meta?.is_container;
15
+ }
16
+
8
17
  export const audit: Audit = {
9
18
  id: 'audits/deep-nesting',
10
19
  title: __( 'Deep container nesting', 'elementor' ),
@@ -21,14 +30,15 @@ export const audit: Audit = {
21
30
  return { status: 'skipped', reason: __( 'No elements', 'elementor' ) };
22
31
  }
23
32
 
33
+ const widgetsCache = getWidgetsCache();
24
34
  const violations: AuditViolation[] = [];
25
35
 
26
36
  walkElements( ctx.elements.tree, ( node, parents ) => {
27
- if ( node.elType !== 'container' ) {
37
+ if ( ! isNestingElement( node, widgetsCache ) ) {
28
38
  return;
29
39
  }
30
40
 
31
- const depth = parents.length + 1;
41
+ const depth = parents.filter( ( parent ) => isNestingElement( parent, widgetsCache ) ).length + 1;
32
42
 
33
43
  if ( depth > MAX_NESTING_DEPTH ) {
34
44
  violations.push( {
@@ -1,10 +1,19 @@
1
+ import { getWidgetsCache } from '@elementor/editor-elements';
1
2
  import { __ } from '@wordpress/i18n';
2
3
 
3
- import { type Audit } from '../types';
4
+ import { type Audit, type ElementSnapshotNode } from '../types';
4
5
  import { walkElements } from '../utils/walk';
5
6
 
6
7
  const WIDGET_COUNT_THRESHOLD = 100;
7
8
 
9
+ function isCountableWidget( node: ElementSnapshotNode, widgetsCache: ReturnType< typeof getWidgetsCache > ): boolean {
10
+ if ( node.elType === 'widget' ) {
11
+ return true;
12
+ }
13
+
14
+ return !! widgetsCache?.[ node.elType ]?.meta?.is_compound;
15
+ }
16
+
8
17
  export const audit: Audit = {
9
18
  id: 'audits/too-many-widgets',
10
19
  title: __( 'Too many widgets', 'elementor' ),
@@ -18,10 +27,11 @@ export const audit: Audit = {
18
27
  return { status: 'skipped', reason: __( 'No elements', 'elementor' ) };
19
28
  }
20
29
 
30
+ const widgetsCache = getWidgetsCache();
21
31
  let widgetCount = 0;
22
32
 
23
33
  walkElements( ctx.elements.tree, ( node ) => {
24
- if ( node.elType === 'widget' ) {
34
+ if ( isCountableWidget( node, widgetsCache ) ) {
25
35
  widgetCount++;
26
36
  }
27
37
  } );
@@ -26,7 +26,13 @@ export default function AuditPanel() {
26
26
  badge={ __( 'Beta', 'elementor' ) }
27
27
  titleVariant="subtitle2"
28
28
  />
29
- <FloatingPanelBody>
29
+ <FloatingPanelBody
30
+ sx={
31
+ status === 'ready'
32
+ ? { display: 'flex', flexDirection: 'column', overflow: 'hidden', minHeight: 0 }
33
+ : undefined
34
+ }
35
+ >
30
36
  { status === 'idle' && <WelcomePage /> }
31
37
  { status === 'loading' && <LoadingPage /> }
32
38
  { status === 'error' && <ErrorPage message={ error ?? '' } onRetry={ onRun } /> }
@@ -0,0 +1,65 @@
1
+ import * as React from 'react';
2
+ import { Box, Divider, Typography } from '@elementor/ui';
3
+ import { __, sprintf } from '@wordpress/i18n';
4
+
5
+ import { type PageAuditReport } from '../types';
6
+ import {
7
+ auditStatusColor,
8
+ auditStatusDisplayCounts,
9
+ type AuditStatusGroup,
10
+ auditStatusLabel,
11
+ } from '../utils/audit-status-summary';
12
+ import CountSummaryCircle from './count-summary-circle';
13
+
14
+ type Props = {
15
+ report: PageAuditReport;
16
+ onStatusClick: ( status: AuditStatusGroup ) => void;
17
+ };
18
+
19
+ const STATUS_ARIA_LABELS: Record< AuditStatusGroup, ( count: number ) => string > = {
20
+ pass: ( count ) =>
21
+ sprintf(
22
+ /* translators: %d: number of passed audits. */
23
+ __( '%d passed audits, view all', 'elementor' ),
24
+ count
25
+ ),
26
+ fail: ( count ) =>
27
+ sprintf(
28
+ /* translators: %d: number of failed audit violations. */
29
+ __( '%d failed audits, view all', 'elementor' ),
30
+ count
31
+ ),
32
+ skipped: ( count ) =>
33
+ sprintf(
34
+ /* translators: %d: number of skipped audits. */
35
+ __( '%d skipped audits, view all', 'elementor' ),
36
+ count
37
+ ),
38
+ };
39
+
40
+ const STATUS_GROUPS = [ 'fail', 'pass', 'skipped' ] as const;
41
+
42
+ export default function AuditStatusesSection( { report, onStatusClick }: Props ) {
43
+ const statusCounts = auditStatusDisplayCounts( report );
44
+
45
+ return (
46
+ <>
47
+ <Typography variant="subtitle1" fontWeight="bold">
48
+ { __( 'Audit statuses', 'elementor' ) }
49
+ </Typography>
50
+ <Box sx={ { display: 'flex', justifyContent: 'space-around', gap: 2 } }>
51
+ { STATUS_GROUPS.map( ( status ) => (
52
+ <CountSummaryCircle
53
+ key={ status }
54
+ ariaLabel={ STATUS_ARIA_LABELS[ status ]( statusCounts[ status ] ) }
55
+ color={ auditStatusColor( status ) }
56
+ count={ statusCounts[ status ] }
57
+ label={ auditStatusLabel( status ) }
58
+ onClick={ () => onStatusClick( status ) }
59
+ />
60
+ ) ) }
61
+ </Box>
62
+ <Divider />
63
+ </>
64
+ );
65
+ }
@@ -1,17 +1,11 @@
1
- import {
2
- ElementorAccessibilityIcon,
3
- FilterIcon,
4
- HeartHandShakeIcon,
5
- Settings2Icon,
6
- ShieldHalfFilledIcon,
7
- } from '@elementor/icons';
1
+ import { BoltIcon, ElementorAccessibilityIcon, FileSearchIcon, Settings2Icon, ShieldCheckIcon } from '@elementor/icons';
8
2
 
9
3
  import type { AuditCategory } from '../types';
10
4
 
11
5
  export const CATEGORY_ICONS: Record< AuditCategory, typeof Settings2Icon > = {
12
6
  'best-practices': Settings2Icon,
13
- seo: FilterIcon,
7
+ seo: FileSearchIcon,
14
8
  accessibility: ElementorAccessibilityIcon,
15
- performance: ShieldHalfFilledIcon,
16
- compliance: HeartHandShakeIcon,
9
+ performance: BoltIcon,
10
+ compliance: ShieldCheckIcon,
17
11
  };
@@ -1,25 +1,42 @@
1
1
  import * as React from 'react';
2
+ import { useState } from 'react';
2
3
  import { Box, Link, Typography } from '@elementor/ui';
3
4
  import { __ } from '@wordpress/i18n';
4
5
 
5
6
  import { ALL_CATEGORIES, CATEGORY_LABELS } from '../../constants';
6
7
  import { type AuditCategory, type PageAuditReport } from '../../types';
7
- import { getPopulatedCategories } from '../../utils/audit-status-summary';
8
- import { countSeverities } from '../../utils/severity-counts';
8
+ import { type AuditStatusGroup, getPopulatedCategories } from '../../utils/audit-status-summary';
9
+ import { countSeverities, type SeverityCounts } from '../../utils/severity-counts';
10
+ import AuditStatusesSection from '../audit-statuses-section';
9
11
  import IssuesCategoryRow from '../issues-category-row';
10
- import Promotions from '../promotions';
12
+ import SeverityFilterChips, { type SeverityFilter } from '../severity-filter-chips';
11
13
 
12
14
  type Props = {
13
15
  report: PageAuditReport;
14
16
  onCategoryClick: ( category: AuditCategory ) => void;
15
17
  onAllAuditsClick: () => void;
18
+ onStatusClick: ( status: AuditStatusGroup ) => void;
16
19
  };
17
20
 
18
- export default function IssuesPage( { report, onCategoryClick, onAllAuditsClick }: Props ) {
21
+ function filterCounts( counts: SeverityCounts, filter: SeverityFilter ): SeverityCounts {
22
+ if ( filter === 'all' ) {
23
+ return counts;
24
+ }
25
+
26
+ return { error: 0, warning: 0, info: 0, [ filter ]: counts[ filter ] };
27
+ }
28
+
29
+ export default function IssuesPage( { report, onCategoryClick, onAllAuditsClick, onStatusClick }: Props ) {
30
+ const [ filter, setFilter ] = useState< SeverityFilter >( 'all' );
19
31
  const populatedCategories = getPopulatedCategories( report.categories, ALL_CATEGORIES );
20
32
 
33
+ const categoryRows = populatedCategories
34
+ .map( ( category ) => ( { category, counts: filterCounts( countSeverities( report, category ), filter ) } ) )
35
+ .filter( ( { counts } ) => Object.values( counts ).some( ( count ) => count > 0 ) );
36
+
21
37
  return (
22
38
  <Box sx={ { display: 'flex', flexDirection: 'column', gap: 4, p: 2 } }>
39
+ <AuditStatusesSection report={ report } onStatusClick={ onStatusClick } />
23
40
  <Link
24
41
  component="button"
25
42
  underline="none"
@@ -31,18 +48,18 @@ export default function IssuesPage( { report, onCategoryClick, onAllAuditsClick
31
48
  { __( 'All issues', 'elementor' ) }
32
49
  </Typography>
33
50
  </Link>
51
+ <SeverityFilterChips selected={ filter } onChange={ setFilter } />
34
52
  <Box sx={ { display: 'flex', flexDirection: 'column', gap: 1 } }>
35
- { populatedCategories.map( ( category ) => (
53
+ { categoryRows.map( ( { category, counts } ) => (
36
54
  <IssuesCategoryRow
37
55
  key={ category }
38
56
  category={ category }
39
57
  label={ CATEGORY_LABELS[ category ] }
40
- counts={ countSeverities( report, category ) }
58
+ counts={ counts }
41
59
  onClick={ () => onCategoryClick( category ) }
42
60
  />
43
61
  ) ) }
44
62
  </Box>
45
- <Promotions report={ report } />
46
63
  </Box>
47
64
  );
48
65
  }
@@ -1,61 +1,22 @@
1
1
  import * as React from 'react';
2
- import { Box, Chip, Divider, Typography } from '@elementor/ui';
3
- import { __, sprintf } from '@wordpress/i18n';
2
+ import { Box, Chip, Typography } from '@elementor/ui';
3
+ import { __ } from '@wordpress/i18n';
4
4
 
5
5
  import { ALL_CATEGORIES, CATEGORY_LABELS } from '../../constants';
6
6
  import { type AuditCategory, type PageAuditReport } from '../../types';
7
- import {
8
- auditStatusColor,
9
- auditStatusDisplayCounts,
10
- type AuditStatusGroup,
11
- auditStatusLabel,
12
- getPopulatedCategories,
13
- } from '../../utils/audit-status-summary';
7
+ import { getPopulatedCategories } from '../../utils/audit-status-summary';
14
8
  import { getScoreTier } from '../../utils/score-thresholds';
15
- import {
16
- ALL_SEVERITIES,
17
- countSeverities,
18
- severityPluralLabel,
19
- severityRemainingCountLabel,
20
- } from '../../utils/severity-counts';
21
- import CountSummaryCircle from '../count-summary-circle';
9
+ import Promotions from '../promotions';
22
10
  import ScoreBar from '../score-bar';
23
11
  import ScoreCircle from '../score-circle';
24
- import SeverityIcon from '../severity-icons';
25
12
 
26
13
  type Props = {
27
14
  onCategoryClick: ( category: AuditCategory ) => void;
28
- onStatusClick: ( status: AuditStatusGroup ) => void;
29
15
  report: PageAuditReport;
30
16
  };
31
17
 
32
- const STATUS_ARIA_LABELS: Record< AuditStatusGroup, ( count: number ) => string > = {
33
- pass: ( count ) =>
34
- sprintf(
35
- /* translators: %d: number of passed audits. */
36
- __( '%d passed audits, view all', 'elementor' ),
37
- count
38
- ),
39
- fail: ( count ) =>
40
- sprintf(
41
- /* translators: %d: number of failed audit violations. */
42
- __( '%d failed audits, view all', 'elementor' ),
43
- count
44
- ),
45
- skipped: ( count ) =>
46
- sprintf(
47
- /* translators: %d: number of skipped audits. */
48
- __( '%d skipped audits, view all', 'elementor' ),
49
- count
50
- ),
51
- };
52
-
53
- const STATUS_GROUPS = [ 'fail', 'pass', 'skipped' ] as const;
54
-
55
- export default function OverviewPage( { onCategoryClick, onStatusClick, report }: Props ) {
18
+ export default function OverviewPage( { onCategoryClick, report }: Props ) {
56
19
  const populatedCategories = getPopulatedCategories( report.categories, ALL_CATEGORIES );
57
- const severityCounts = countSeverities( report );
58
- const statusCounts = auditStatusDisplayCounts( report );
59
20
  const overallScore = getScoreTier( report.overall );
60
21
 
61
22
  return (
@@ -85,56 +46,7 @@ export default function OverviewPage( { onCategoryClick, onStatusClick, report }
85
46
  />
86
47
  ) ) }
87
48
  </Box>
88
- <Divider />
89
- <Typography variant="subtitle1" fontWeight="bold">
90
- { __( 'Audit statuses', 'elementor' ) }
91
- </Typography>
92
- <Box sx={ { display: 'flex', justifyContent: 'space-around', gap: 2 } }>
93
- { STATUS_GROUPS.map( ( status ) => (
94
- <CountSummaryCircle
95
- key={ status }
96
- ariaLabel={ STATUS_ARIA_LABELS[ status ]( statusCounts[ status ] ) }
97
- color={ auditStatusColor( status ) }
98
- count={ statusCounts[ status ] }
99
- label={ auditStatusLabel( status ) }
100
- onClick={ () => onStatusClick( status ) }
101
- />
102
- ) ) }
103
- </Box>
104
- <Divider />
105
- <Typography variant="subtitle1" fontWeight="bold">
106
- { __( 'Remaining issues', 'elementor' ) }
107
- </Typography>
108
- <Box
109
- component="ul"
110
- sx={ {
111
- display: 'flex',
112
- flexDirection: 'column',
113
- gap: 1,
114
- listStyle: 'none',
115
- m: 0,
116
- p: 0,
117
- } }
118
- >
119
- { ALL_SEVERITIES.map( ( severity ) => {
120
- const count = severityCounts[ severity ];
121
-
122
- return (
123
- <Box
124
- aria-label={ severityRemainingCountLabel( severity, count ) }
125
- component="li"
126
- key={ severity }
127
- sx={ { alignItems: 'center', display: 'flex', gap: 0.5 } }
128
- >
129
- <SeverityIcon severity={ severity } />
130
- <Typography variant="body2" fontWeight="bold">
131
- { count }
132
- </Typography>
133
- <Typography variant="body2">{ severityPluralLabel( severity ) }</Typography>
134
- </Box>
135
- );
136
- } ) }
137
- </Box>
49
+ <Promotions report={ report } />
138
50
  </Box>
139
51
  );
140
52
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { Box, Typography } from '@elementor/ui';
2
+ import { Box, Divider, Typography } from '@elementor/ui';
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
5
  import { PROMOTIONS } from '../register-promotions';
@@ -44,8 +44,9 @@ export default function Promotions( { report }: Props ) {
44
44
 
45
45
  return (
46
46
  <>
47
+ <Divider />
47
48
  <Typography variant="subtitle1" fontWeight="bold">
48
- { __( 'Quick wins', 'elementor' ) }
49
+ { __( 'Quick actions', 'elementor' ) }
49
50
  </Typography>
50
51
  <Box sx={ { display: 'flex', flexDirection: 'column', gap: 1 } }>
51
52
  { cards.map( ( { config, ctaUrl, key, run, subtitle } ) => (
@@ -66,45 +66,49 @@ export default function ReportShell( { report }: Props ) {
66
66
  };
67
67
 
68
68
  return (
69
- <Box>
70
- <Tabs
71
- aria-label={ __( 'Audit navigation', 'elementor' ) }
72
- value={ currentTab }
73
- onChange={ handleTabChange }
74
- textColor="secondary"
75
- indicatorColor="secondary"
76
- size="small"
77
- centered={ true }
78
- variant="fullWidth"
79
- >
80
- <Tab value="overview" label={ __( 'Overview', 'elementor' ) } />
81
- <Tab value="issues" label={ __( 'Issues', 'elementor' ) } />
82
- </Tabs>
83
- <Divider />
84
- { activePage === 'overview' && (
85
- <OverviewPage
86
- report={ report }
87
- onCategoryClick={ ( category ) => openCategory( category, 'overview' ) }
88
- onStatusClick={ ( status ) => openAllAudits( status, 'overview' ) }
89
- />
90
- ) }
91
- { activePage === 'issues' && (
92
- <IssuesPage
93
- report={ report }
94
- onCategoryClick={ ( category ) => openCategory( category, 'issues' ) }
95
- onAllAuditsClick={ () => openAllAudits() }
96
- />
97
- ) }
98
- { isAllAuditsPage( activePage ) && (
99
- <AllAuditsPage
100
- report={ report }
101
- initialExpandedStatus={ activePage.expand }
102
- onBack={ backFromSubPage }
103
- />
104
- ) }
105
- { isCategoryPage( activePage ) && (
106
- <CategoryPage category={ activePage.category } report={ report } onBack={ backFromSubPage } />
107
- ) }
69
+ <Box sx={ { display: 'flex', flexDirection: 'column', flex: 1, minHeight: 0 } }>
70
+ <Box sx={ { flexShrink: 0 } }>
71
+ <Tabs
72
+ aria-label={ __( 'Audit navigation', 'elementor' ) }
73
+ value={ currentTab }
74
+ onChange={ handleTabChange }
75
+ textColor="secondary"
76
+ indicatorColor="secondary"
77
+ size="small"
78
+ centered={ true }
79
+ variant="fullWidth"
80
+ >
81
+ <Tab value="overview" label={ __( 'Overview', 'elementor' ) } />
82
+ <Tab value="issues" label={ __( 'Issues', 'elementor' ) } />
83
+ </Tabs>
84
+ <Divider />
85
+ </Box>
86
+ <Box sx={ { flex: 1, minHeight: 0, overflowY: 'auto' } }>
87
+ { activePage === 'overview' && (
88
+ <OverviewPage
89
+ report={ report }
90
+ onCategoryClick={ ( category ) => openCategory( category, 'overview' ) }
91
+ />
92
+ ) }
93
+ { activePage === 'issues' && (
94
+ <IssuesPage
95
+ report={ report }
96
+ onCategoryClick={ ( category ) => openCategory( category, 'issues' ) }
97
+ onAllAuditsClick={ () => openAllAudits() }
98
+ onStatusClick={ ( status ) => openAllAudits( status ) }
99
+ />
100
+ ) }
101
+ { isAllAuditsPage( activePage ) && (
102
+ <AllAuditsPage
103
+ report={ report }
104
+ initialExpandedStatus={ activePage.expand }
105
+ onBack={ backFromSubPage }
106
+ />
107
+ ) }
108
+ { isCategoryPage( activePage ) && (
109
+ <CategoryPage category={ activePage.category } report={ report } onBack={ backFromSubPage } />
110
+ ) }
111
+ </Box>
108
112
  </Box>
109
113
  );
110
114
  }
@@ -0,0 +1,57 @@
1
+ import * as React from 'react';
2
+ import { Box, Chip } from '@elementor/ui';
3
+ import { __ } from '@wordpress/i18n';
4
+
5
+ import { type AuditSeverity } from '../types';
6
+ import { ALL_SEVERITIES, severityPluralLabel } from '../utils/severity-counts';
7
+ import SeverityIcon from './severity-icons';
8
+
9
+ export type SeverityFilter = 'all' | AuditSeverity;
10
+
11
+ type Props = {
12
+ selected: SeverityFilter;
13
+ onChange: ( filter: SeverityFilter ) => void;
14
+ };
15
+
16
+ export default function SeverityFilterChips( { selected, onChange }: Props ) {
17
+ return (
18
+ <Box sx={ { display: 'flex', alignItems: 'center', gap: 1 } }>
19
+ <FilterChip
20
+ label={ __( 'All', 'elementor' ) }
21
+ isSelected={ selected === 'all' }
22
+ onClick={ () => onChange( 'all' ) }
23
+ />
24
+ { ALL_SEVERITIES.map( ( severity ) => (
25
+ <FilterChip
26
+ key={ severity }
27
+ label={ severityPluralLabel( severity ) }
28
+ icon={ <SeverityIcon severity={ severity } /> }
29
+ isSelected={ selected === severity }
30
+ onClick={ () => onChange( severity ) }
31
+ />
32
+ ) ) }
33
+ </Box>
34
+ );
35
+ }
36
+
37
+ type FilterChipProps = {
38
+ label: string;
39
+ icon?: React.ReactElement;
40
+ isSelected: boolean;
41
+ onClick: () => void;
42
+ };
43
+
44
+ function FilterChip( { label, icon, isSelected, onClick }: FilterChipProps ) {
45
+ return (
46
+ <Chip
47
+ label={ label }
48
+ icon={ icon }
49
+ size="small"
50
+ variant="filled"
51
+ color="default"
52
+ onClick={ onClick }
53
+ aria-pressed={ isSelected }
54
+ sx={ { bgcolor: isSelected ? 'action.selected' : 'transparent' } }
55
+ />
56
+ );
57
+ }
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { AlertCircleIcon, AlertTriangleFilledIcon, InfoCircleIcon } from '@elementor/icons';
2
+ import { AlertCircleIcon, AlertTriangleFilledIcon, BulbIcon } from '@elementor/icons';
3
3
 
4
4
  import { type AuditSeverity } from '../types';
5
5
 
@@ -13,7 +13,7 @@ type SeverityConfig = {
13
13
  const SEVERITY_CONFIG: Record< AuditSeverity, SeverityConfig > = {
14
14
  error: { Icon: AlertTriangleFilledIcon, color: 'error' },
15
15
  warning: { Icon: AlertCircleIcon, color: 'warning' },
16
- info: { Icon: InfoCircleIcon, color: 'info' },
16
+ info: { Icon: BulbIcon, color: 'info' },
17
17
  };
18
18
 
19
19
  type Props = {
package/src/constants.ts CHANGED
@@ -31,5 +31,5 @@ export const CATEGORY_LABELS: Record< AuditCategory, string > = {
31
31
  seo: __( 'SEO', 'elementor' ),
32
32
  accessibility: __( 'Accessibility', 'elementor' ),
33
33
  performance: __( 'Performance', 'elementor' ),
34
- compliance: __( 'Compliance', 'elementor' ),
34
+ compliance: __( 'Site compliance', 'elementor' ),
35
35
  };
@@ -1,4 +1,4 @@
1
- import { __, sprintf } from '@wordpress/i18n';
1
+ import { __ } from '@wordpress/i18n';
2
2
 
3
3
  import { type AuditCategory, type AuditSeverity, type PageAuditReport } from '../types';
4
4
  import { isScoredAudit } from './is-scored-audit';
@@ -36,29 +36,6 @@ export function severityPluralLabel( severity: AuditSeverity ): string {
36
36
  case 'warning':
37
37
  return __( 'Warnings', 'elementor' );
38
38
  case 'info':
39
- return __( 'Info', 'elementor' );
40
- }
41
- }
42
-
43
- export function severityRemainingCountLabel( severity: AuditSeverity, count: number ): string {
44
- switch ( severity ) {
45
- case 'error':
46
- return sprintf(
47
- /* translators: %d: number of remaining error violations. */
48
- __( '%d errors', 'elementor' ),
49
- count
50
- );
51
- case 'warning':
52
- return sprintf(
53
- /* translators: %d: number of remaining warning violations. */
54
- __( '%d warnings', 'elementor' ),
55
- count
56
- );
57
- case 'info':
58
- return sprintf(
59
- /* translators: %d: number of remaining info violations. */
60
- __( '%d info', 'elementor' ),
61
- count
62
- );
39
+ return __( 'Suggestions', 'elementor' );
63
40
  }
64
41
  }