內容簡介
總結:PHP 相容性掃描器幫助你評估網站的程式碼(外掛和主題)是否能適應較新版本的 PHP。透過使用 PHP_CodeSniffer 和 PHPCompatibilityWP 規則集進行靜態分析,以標示與所選目標 PHP 版本不相容的程式碼模式。
問題與答案:
1. PHP 相容性掃描器是用來做什麼的?
- 幫助評估網站的程式碼是否能在較新的 PHP 版本上運行。
2. 哪些是此外掛程式的功能?
- 比較目前 PHP 執行時間(基線)和所選目標 PHP 版本(8.0–8.4)。
- 掃描外掛和主題,然後突顯只有在目標版本上會出現的新問題(“delta”)。
- 在工具畫面上顯示清晰的報告,並在外掛清單畫面上添加小徽章。
- 讓你暫停、恢復或停止正在運行的掃描。
3. 靜態分析有哪些重要限制?
- 靜態分析可能會遺漏動態代碼路徑中的問題,也可能生成誤報。將結果視為指南而非保證。在將 PHP 升級到正式環境之前,請始終在測試站環境中測試網站功能。
4. 此外掛有哪些隱私保護功能?
- 所有分析在您的伺服器上本地運行。此外掛不會將任何數據發送到外部服務。
外掛標籤
開發者團隊
② 後台搜尋「BrightLeaf Digital PHP Compatibility Scanner」→ 直接安裝(推薦)
原文外掛簡介
PHP Compatibility Scanner helps you assess whether your site’s code (plugins and themes) is likely to run on newer versions of PHP. It performs static analysis using PHP_CodeSniffer and the PHPCompatibilityWP ruleset to flag code patterns that are incompatible with the selected target PHP version.
What the plugin does (at a glance):
– Compares your current runtime PHP (baseline) to a selected target PHP version (8.0–8.4).
– Scans plugins and themes, then highlights only the new issues that would appear on the target version (the “delta”).
– Shows results in a clear report on the Tools screen and adds small badges on the Plugins list screen.
– Lets you pause, resume, or stop a running scan.
Important limitations of static analysis:
– Static analysis can miss issues in dynamic code paths and can generate false positives. Treat results as guidance, not guarantees. Always test site functionality on a staging environment before upgrading PHP in production.
Features
Select a target PHP version (8.0, 8.1, 8.2, 8.3, 8.4)
Scan all plugins or select specific ones
Scan all themes or select specific ones, with an option to also scan a parent if a child theme is selected
Pause/Resume/Stop controls for long scans
Clear report of only the new issues between baseline (current runtime) and target
Plugin list badges showing a quick summary for the last scan
Privacy
All analysis runs locally on your server. No data is sent to external services by this plugin.
