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

Research direction

Start by reviewing the requested wp_deregister_style and wp_dequeue_script cases and the linked Query Monitor dispatchers/Html.php references for the required asset handles. Define the sniff behavior so dashicons and jquery are reported when deregistered or dequeued, while similarly named handles such as not_dashicons and not_jquery are not; completion requires coverage for both violation and non-violation examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.