Runtime checks that simulate frontend request not reliable in AJAX based workflow

オープン
#750 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
php
領域
testing-qa

調査の方向性

まず、AJAX ベースと WP-CLI ベースの両方のフローで contact-form-7 に対して Performance checks を実行し、Enqueued_Scripts_Scope_Check と Enqueued_Styles_Scope_Check に焦点を当てます。結果を比較し、runtime-check のエントリポイントを追跡して、frontend の動作がどのように表現されているかを確認します。AJAX フローが同じ frontend-only の enqueue 問題を確実に検出できれば完了です。

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

説明

[Team] Performance [Type] Bug Checks WP Admin

When running runtime checks like Enqueued_Scripts_Scope_Check or Enqueued_Styles_Scope_Check using the AJAX based flow, they may not detect problems correctly. A crucial issue is that AJAX requests are considered "WP Admin", so functions like is_admin() will return true. It's common for plugins to have a check like ! is_admin() around initialization logic that is specifically for the frontend, which means any such behaviors will not be spotted.

You can verify this by running the "Performance" checks against contact-form-7 for example, which enqueues scripts and stylesheets across the entire site.

The AJAX based flow won't detect that - only the WP-CLI based flow will. The latter is because WP-CLI does not run in "WP Admin context".

I'm not sure there's a way to override what is_admin() returns... But worth thinking through this.

主要言語
PHP
スター
365
フォーク
135
平均マージ
1日 8時間
マージ済み PR(30日)
20

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

WordPress/plugin-check のほかの issue

WordPress/plugin-check の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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