Sniff for getimagesize()

未關閉
#685 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
php
領域
tooling

研究方向

先從 getimagesize() 違規範例和建議的 wp_get_attachment_metadata() 路徑開始,然後檢視規則集如何識別 PHP 函式呼叫。在定義完成標準並為這兩種情況新增涵蓋範圍之前,釐清媒體庫圖片與外部 URL 的預期處理方式。

由索引模型根據 Issue 內容生成。

描述

What problem would the enhancement address for VIP?

getimagesize() holds up the PHP process downloading the entire image to just read its file size.

Describe the solution you'd like

Most images in WPs Media Library have width and height attributes already (like from wp_get_attachment_metadata()) & that existing data should be used instead.

If the image is external and not in WordPress' media library, perhapes:

What code should be reported as a violation?

$size = getimagesize( $image_url );
list($width, $height) = getimagesize( $image_url );
//etc.
主要語言
PHP
星號
261
分支
44
平均合併
3 天 9 小時
30 天內合併 PR
10

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

Automattic/VIP-Coding-Standards 的其他 Issue

查看 Automattic/VIP-Coding-Standards 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。