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 天内回复