Automattic / Automattic/VIP-Coding-Standards

Disallow deregistering/deqeueing of certain assets that break QM

Open
#695 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
261
Forks
44
Avg merge
19m
Merged PRs (30d)
1

Description

## What problem would the enhancement address for VIP?
Sometimes certain core assets are deregistered/dequeued which break Query Monitor, which adds an extra step during debugging to track that down.

Dependencies are:
- `dashicons` https://github.com/Automattic/vip-go-mu-plugins-built/blob/d38a2b0e4a1be875302942783cfe49f7f343e226/query-monitor/dispatchers/Html.php#L187-L192
- `jquery` https://github.com/Automattic/vip-go-mu-plugins-built/blob/d38a2b0e4a1be875302942783cfe49f7f343e226/query-monitor/dispatchers/Html.php#L170-L199

## Describe the solution you'd like

It'd be good to have a sniff that warns for specific assets that we do not recommend removing.

## What code should be reported as a violation?

```
wp_deregister_style( 'dashicons' );
```
```
wp_dequeue_script( 'jquery' );
```

## What code should *not* be reported as a violation?

```
wp_dequeue_style( 'not_dashicons' );
```
```
wp_dequeue_script( 'not_jquery' );
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.