Welcome notice checks for Otter at a hard-coded `wp-content/plugins` path
還沒有人認領這個 Issue。
評估
研究方向
該檢查位於 inc/Admin.php 中 get_otter_status() 內、大約第 304 行;開啟該函式並確認其傳回值如何選擇 Install & Activate 還是 Activate 標籤。將硬編碼的 ABSPATH . 'wp-content/plugins/...' 路徑替換為 WP_PLUGIN_DIR . '/otter-blocks/otter-blocks.php',或針對該鍵測試 get_plugins(),其餘函式保持不變。完成意味著當外掛目錄已透過 WP_PLUGIN_DIR 移動時,該通知會為已安裝但未啟用的 Otter 提供 Activate。
由索引模型根據 Issue 內容生成。
描述
What's wrong
The welcome notice ("Power up your website building experience with Otter Blocks!") decides between Install & Activate Otter Blocks and Activate Otter Blocks by checking for this file:
// inc/Admin.php, get_otter_status(), line 304
if ( file_exists( ABSPATH . 'wp-content/plugins/otter-blocks/otter-blocks.php' ) ) {
That path is only right when the plugins folder sits in the default place. On sites that move it (WP_CONTENT_DIR / WP_PLUGIN_DIR, as Bedrock and many managed hosts do), an installed but inactive Otter is reported as not installed. The button then says Install & Activate, asks WordPress to install a plugin that's already there (that request fails), and then activates it anyway. The end result works, but the label is wrong and an install request is wasted.
Found by reading the code; not reproduced on a moved plugins folder.
Suggested fix
if ( file_exists( WP_PLUGIN_DIR . '/otter-blocks/otter-blocks.php' ) ) {
or check get_plugins() for otter-blocks/otter-blocks.php.
- 主要語言
- PHP
- 星號
- 0
- 分支
- 0
- 平均合併
- 1 小時 2 分鐘
- 30 天內合併 PR
- 5
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Codeinwp/fork 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 92/100
-
難度 1/5 1 小時以內 新手友好度 88/100
-
難度 2/5 1-3 小時 新手友好度 82/100
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 1/5 1 小時以內 新手友好度 88/100
相似的 Issue
-
Change: check an identifier filter the same way in every tool - the order of somcp_search_orders未關閉consistency enhancement Orders
難度 1/5 1 小時以內 新手友好度 88/100
novalo-dev/Prestashop-MCP-Server#343 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
claude
難度 2/5 1-3 小時 新手友好度 72/100
sprain/sprainocchio#45 ·
維護者通常 1 天內回覆
-
sync-en
難度 1/5 1 小時以內 新手友好度 85/100
維護者通常 1 天內回覆
-
sync-en
難度 1/5 1 小時以內 新手友好度 85/100
維護者通常 1 天內回覆