@elementor/editor-audits 4.4.0-1128 → 4.4.0-1130

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.4.0-1128",
3
+ "version": "4.4.0-1130",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,21 +39,21 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.4.0-1128",
43
- "@elementor/editor-mcp": "4.4.0-1128",
44
- "@elementor/editor-app-bar": "4.4.0-1128",
45
- "@elementor/editor-elements": "4.4.0-1128",
46
- "@elementor/editor-floating-panels": "4.4.0-1128",
47
- "@elementor/editor-notifications": "4.4.0-1128",
48
- "@elementor/editor-props": "4.4.0-1128",
49
- "@elementor/editor-styles": "4.4.0-1128",
50
- "@elementor/editor-v1-adapters": "4.4.0-1128",
51
- "@elementor/events": "4.4.0-1128",
52
- "@elementor/http-client": "4.4.0-1128",
42
+ "@elementor/editor": "4.4.0-1130",
43
+ "@elementor/editor-mcp": "4.4.0-1130",
44
+ "@elementor/editor-app-bar": "4.4.0-1130",
45
+ "@elementor/editor-elements": "4.4.0-1130",
46
+ "@elementor/editor-floating-panels": "4.4.0-1130",
47
+ "@elementor/editor-notifications": "4.4.0-1130",
48
+ "@elementor/editor-props": "4.4.0-1130",
49
+ "@elementor/editor-styles": "4.4.0-1130",
50
+ "@elementor/editor-v1-adapters": "4.4.0-1130",
51
+ "@elementor/events": "4.4.0-1130",
52
+ "@elementor/http-client": "4.4.0-1130",
53
53
  "@elementor/icons": "~1.78.1",
54
- "@elementor/locations": "4.4.0-1128",
55
- "@elementor/session": "4.4.0-1128",
56
- "@elementor/store": "4.4.0-1128",
54
+ "@elementor/locations": "4.4.0-1130",
55
+ "@elementor/session": "4.4.0-1130",
56
+ "@elementor/store": "4.4.0-1130",
57
57
  "@elementor/ui": "1.41.1"
58
58
  },
59
59
  "peerDependencies": {
@@ -33,7 +33,7 @@ function SeverityCard( { severity, count }: SeverityCardProps ) {
33
33
  flex={ 1 }
34
34
  flexDirection="column"
35
35
  gap={ 1 }
36
- bgcolor="grey.50"
36
+ bgcolor="action.hover"
37
37
  borderRadius={ 1.5 }
38
38
  px={ 1.5 }
39
39
  py={ 1 }
@@ -22,7 +22,6 @@ import * as robotsNoindex from './audits/robots-noindex';
22
22
  import * as scanForCookies from './audits/scan-for-cookies';
23
23
  import * as sectionsAndColumns from './audits/sections-and-columns';
24
24
  import * as siteIdentity from './audits/site-identity';
25
- import * as tooManyWidgets from './audits/too-many-widgets';
26
25
  import { registerAudit } from './registry';
27
26
  import { type Audit } from './types';
28
27
 
@@ -33,7 +32,6 @@ const AUDITS: Audit[] = [
33
32
 
34
33
  hiddenElements.audit,
35
34
  deprecatedWidgets.audit,
36
- tooManyWidgets.audit,
37
35
  sectionsAndColumns.audit,
38
36
  deepNesting.audit,
39
37
  nestedBoxedContainers.audit,
@@ -1,53 +0,0 @@
1
- import { getWidgetsCache } from '@elementor/editor-elements';
2
- import { __ } from '@wordpress/i18n';
3
-
4
- import { type Audit, type ElementSnapshotNode } from '../types';
5
- import { walkElements } from '../utils/walk';
6
-
7
- const WIDGET_COUNT_THRESHOLD = 100;
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
-
17
- export const audit: Audit = {
18
- id: 'audits/too-many-widgets',
19
- title: __( 'Too many widgets', 'elementor' ),
20
- description: __( 'Excessive DOM size caused by too many widgets degrades rendering performance.', 'elementor' ),
21
- fixHint: __( 'Reduce the number of widgets on the page by removing or combining elements.', 'elementor' ),
22
- categories: [ 'best-practices', 'performance' ],
23
- severity: 'warning',
24
- weight: 5,
25
- evaluate: ( ctx ) => {
26
- if ( ctx.elements.tree.length === 0 ) {
27
- return { status: 'skipped', reason: __( 'No elements', 'elementor' ) };
28
- }
29
-
30
- const widgetsCache = getWidgetsCache();
31
- let widgetCount = 0;
32
-
33
- walkElements( ctx.elements.tree, ( node ) => {
34
- if ( isCountableWidget( node, widgetsCache ) ) {
35
- widgetCount++;
36
- }
37
- } );
38
-
39
- if ( widgetCount <= WIDGET_COUNT_THRESHOLD ) {
40
- return { status: 'pass' };
41
- }
42
-
43
- return {
44
- status: 'fail',
45
- violations: [
46
- {
47
- auditId: audit.id,
48
- label: __( 'Page has too many widgets.', 'elementor' ),
49
- },
50
- ],
51
- };
52
- },
53
- };