Automattic / Automattic/VIP-Coding-Standards

Disallow deregistering/deqeueing of certain assets that break QM

オープン
#695 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
PHP
スター
261
フォーク
44
平均マージ
19分
マージ済み PR(30日)
1

説明

## 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' );
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、要求されている wp_deregister_style と wp_dequeue_script のケース、および必要なアセットハンドルに関するリンク先の Query Monitor の dispatchers/Html.php 参照を確認します。deregister または dequeue された場合に dashicons と jquery を報告し、not_dashicons や not_jquery のような類似した名前のハンドルは報告しないように sniff の動作を定義します。完了には、違反例と非違反例の両方をカバーする必要があります。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
tooling
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。