Title: CosmautDL
Author: cosmaut
Published: <strong>2026 年 2 月 21 日</strong>
Last modified: 2026 年 3 月 18 日

---

搜索插件

![](https://ps.w.org/cosmautdl/assets/banner-772x250.png?rev=3480190)

![](https://ps.w.org/cosmautdl/assets/icon-256x256.png?rev=3480190)

# CosmautDL

 作者：[cosmaut](https://profiles.wordpress.org/cosmaut/)

[下载](https://downloads.wordpress.org/plugin/cosmautdl.1.0.9.zip)

 * [详情](https://cn.wordpress.org/plugins/cosmautdl/#description)
 * [评价](https://cn.wordpress.org/plugins/cosmautdl/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/cosmautdl/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/cosmautdl/#developers)

 [支持](https://wordpress.org/support/plugin/cosmautdl/)

## 描述

CosmautDL 是一个用于 WordPress 的多网盘下载链接管理插件。
 它可以把零散的网盘链接
整理成清晰的“下载卡片”体验，并提供独立下载页、全站文件树索引与下载点击统计。

关键功能：

 * 文章/页面统一下载卡片 UI
 * 每篇内容都有独立下载页路由
 * 使用跳转路由让外链更整洁
 * 文件树页面可浏览全部共享资源
 * 点击统计存储在你自己的数据库中
 * 可选的微信扫码解锁流程
 * 仅在需要时加载资源

### 支持的网盘

（中文概述）把零散的网盘链接统一整理成下载卡片，并提供独立下载页、文件树索引与下载
统计，让资源分享更规范、更好用。

路由（推荐启用固定链接）：

 * 下载页：/downloads/{post_id}.html（或 ?cosmdl_download=1&post_id={id}）
 * File tree: /downloads/tree.html (or ?cosmdl_tree=1)
 * 统计入口：/downloads/stats.html（或 ?cosmdl_stats=1；仅管理员）
 * Redirect: /{prefix}/{post_id}/{type}.html (or ?cosmdl_redirect=1&post_id={id}&
   type={type})

数据与隐私概览：

 * 将下载点击日志存储在自定义数据表中：{wp_prefix}cosmdl_clicks（post_id、type、
   attach_id、user_id、ip、ua、referer、success、created_at）。
 * 核心功能不依赖外部服务。

### Privacy/External Services

 * 数据收集：插件仅为后台统计与排障记录下载点击的 IP、UA、Referer 与时间；数据仅
   存储在你自己的数据库中，不会对外发送。
 * 外部服务（可选）：启用“统计中显示 IP 地理位置”后，后台会请求 ipapi/ip-api/ipinfo
   进行定位；结果会缓存并在 wp-admin 显示。关闭该功能后不会发生外部请求。
 * 微信扫码解锁（可选）：会将访客浏览器重定向到微信授权（open.weixin.qq.com），并
   由服务器调用 api.weixin.qq.com 端点换取 openid 并检查关注状态。插件不会持久存储
   openid；仅使用短时解锁标记（约 10 分钟），并缓存公众号 access_token（最长约 2
   小时）。
 * 用户可控：你可在插件设置中随时关闭这些可选功能；卸载插件时会清理插件创建的数据
   与缓存。
 * 合规说明：在部分司法辖区，IP 地址属于个人数据；启用 IP 地理定位前请先取得同意
   或满足法律要求。

### 外部服务

仅当你启用相关选项时，此插件才会连接外部服务。

### 1）微信 OAuth 与关注状态检查

 * 服务：微信 / 腾讯
 * Purpose: Used for “WeChat unlock” mode authentication
 * 接口端点：
    - https://open.weixin.qq.com/connect/oauth2/authorize (OAuth authorize, visitor
      browser redirect)
    - https://api.weixin.qq.com/sns/oauth2/access_token (exchange OAuth code for
      openid)
    - https://api.weixin.qq.com/cgi-bin/token (fetch official account access_token)
    - https://api.weixin.qq.com/cgi-bin/user/info（检查关注状态）
 * When: Only if you enable “WeChat unlock” in CosmautDL settings and visitors open
   the unlock URL in WeChat after scanning the QR code.
 * 发送的数据：
    - Visitor browser  open.weixin.qq.com: appid, redirect_uri, response_type, scope,
      state, and standard HTTP request metadata handled by WeChat (e.g., IP address,
      user agent).
    - 你的服务器发送至 api.weixin.qq.com：appid、appsecret、OAuth code、grant_type；
      后续还包括 access_token、openid、lang。
 * Data stored (local): Does not store openid permanently; stores a short-lived 
   unlock flag transient (10 minutes) and caches the official account access_token
   transient (up to ~2 hours, based on API expires_in).
 * 用户可控：你可以在插件设置中随时关闭该功能。
 * Data deletion: Transients expire automatically.（临时缓存自动过期）
 * 服务条款：https://www.wechat.com/en/service_terms.html
 * Privacy Policy: https://www.wechat.com/en/privacy_policy.html

### 2）IP 地理位置查询

 * 服务（可在设置中选择）：
    - https://ipapi.co/
    - https://ip-api.com/
    - https://ipinfo.io/
 * Purpose: To display “IP location” in admin download statistics
 * When: Only if you enable “Show IP location in stats” and open stats details in
   wp-admin.
 * 发送数据：会将点击日志中的 IP 地址从你的服务器发送到所选服务商（请求会缓存）。
 * 缓存：默认缓存 168 小时（7 天）以减少 API 调用。
 * 用户可控：你可以在插件设置中随时关闭该功能。
 * Data Flow: Your server  IP Geolocation API  Your server (IP addresses are sent
   for location lookup)
 * Privacy Impact: IP addresses are considered personal data in some jurisdictions;
   cached results help minimize exposure
 * Data Deletion: Cached geolocation data automatically expires after 7 days; IP
   addresses in click logs can be deleted from admin stats page
 * Terms of Service:
    - ipapi: https://ipapi.co/terms/
    - ip-api: https://ip-api.com/docs/legal
    - ipinfo: https://ipinfo.io/terms-of-service
 * 隐私政策：
    - ipapi: https://ipapi.co/privacy/
    - ip-api: https://ip-api.com/docs/legal
    - ipinfo: https://ipinfo.io/privacy-policy

### Third-party libraries

### phpqrcode

 * 库：phpqrcode（LGPL-3.0）
 * 用途：为微信解锁功能在站内生成二维码。
 * 许可证：GNU 宽通用公共许可证 v3.0
 * 许可证链接：https://www.gnu.org/licenses/lgpl-3.0.html
 * 用途：用于生成解锁二维码，无需外部依赖。
 * Compatibility: LGPL-3.0 is compatible with GPLv3

## 屏幕截图

[⌊下载卡片 UI⌉⌊下载卡片 UI⌉[

下载卡片 UI

[⌊文章编辑器元框⌉⌊文章编辑器元框⌉[

文章编辑器元框

[⌊文件树页面⌉⌊文件树页面⌉[

文件树页面

## 安装

 1. 上传 `cosmautdl` 文件夹到 `/wp-content/plugins/`。
 2. 在“插件”中启用此插件。
 3. 前往 wp-admin 的“CosmautDL”并进行如下配置：
 4.  * 网盘管理（启用/重命名/排序）
     * 路由前缀
     * 下载页模块与可选解锁设置
 5. 编辑文章/页面，在 CosmautDL 元框中填写网盘链接后发布。

## 常见问题

### 如何在文章中添加下载卡片？

编辑文章/页面，在 CosmautDL 元框中粘贴网盘链接（如有提取码也一并填写），发布/更新
后前台会自动渲染下载卡片。

### 我在 /downloads/{id}.html 遇到 404，应该怎么处理？

进入“设置  固定链接”，不改动任何选项，直接点击“保存更改”以刷新重写规则；并确保站
点已开启固定链接。（建议开启固定链接）

### CosmautDL 会存储哪些统计数据？

插件会把点击日志存储在你自己的数据库表中，包含 post_id、网盘类型、IP、User-Agent、
Referer、时间等字段。仅用于下载统计与排查问题，并可在统计页删除记录。

### 默认会对外请求吗？

不会。仅当你启用以下功能时才会发生外部请求：

 * 微信解锁
 * 统计中的 IP 地理定位

### 我可以自定义跳转前缀和网盘列表吗？

可以。你可以在设置中修改跳转路由前缀，并在“网盘管理”中启用/重命名/排序网盘类型；
也提供“其他网盘”用于自定义链接类型。

### 兼容主题吗？

不依赖特定主题。CosmautDL 使用 WordPress 路由与模板钩子，尽量兼容大多数主题。如你的
主题或缓存插件较为激进，修改设置后请清理缓存。

### 是否支持多站点（Multisite）？

CosmautDL 主要在单站点环境测试。多站点环境建议先在测试站点验证兼容性。

## 评价

此插件暂无评价。

## 贡献者及开发者

「CosmautDL」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ cosmaut ](https://profiles.wordpress.org/cosmaut/)

「CosmautDL」插件已被翻译至 1 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/cosmautdl/contributors)
为本插件所做的贡献。

[帮助将「CosmautDL」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/cosmautdl)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/cosmautdl/)，查看[SVN仓库](https://plugins.svn.wordpress.org/cosmautdl/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/cosmautdl/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/cosmautdl/)。

## 更新日志

#### 1.0.9

 * 2026-03-18 维护更新：对齐插件版本与 readme 的 stable tag，保持 Text Domain 一致性，
   并为 WordPress.org 语言包生成准备稳定版发布元数据。

#### 1.0.8

 * 2026-02-14 维护更新：适配测试至 WordPress 6.9，并进行小幅代码优化与兼容性增强。

#### 1.0.7

 * 2026-01-25 维护更新：内置站内二维码生成库用于解锁二维码渲染，并加强后台权限检查。

#### 1.0.6

 * 2026-01-15 安全更新：全面安全加固，包括修复 SQL 注入、移除 AJAX URL 硬编码、为
   下载跳转增加 nonce 校验，并为全部 AJAX 处理器补充 nonce 检查。

#### 1.0.5

 * 2026-01-10 Security: Add nonce verification for admin AJAX actions.（后台 AJAX
   安全加固）

#### 1.0.4

 * 2026-01-06 修复下载统计详情展开问题，并确保点击日志记录 IP/UA。

#### 1.0.3

 * 2026-01-03 Smart recognition of cloud drive links in the editor meta box.（编辑
   器网盘链接智能识别）

#### 1.0.2

 * 2026-01-02 Initial release with download page, file tree, and click statistics.

## 额外信息

 *  版本 **1.0.9**
 *  最后更新：**7 月前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 6.2 或更高版本 **
 *  已测试的最高版本为 **6.9.10**
 *  PHP 版本 ** 7.4 或更高版本 **
 *  语言
 * [Chinese (China)](https://cn.wordpress.org/plugins/cosmautdl/) 和 [English (US)](https://wordpress.org/plugins/cosmautdl/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/cosmautdl)
 * 标签
 * [download](https://cn.wordpress.org/plugins/tags/download/)[download manager](https://cn.wordpress.org/plugins/tags/download-manager/)
   [file download](https://cn.wordpress.org/plugins/tags/file-download/)
 *  [高级视图](https://cn.wordpress.org/plugins/cosmautdl/advanced/)

## 评级

尚未提交反馈。

[您的评价](https://wordpress.org/support/plugin/cosmautdl/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/cosmautdl/reviews/)

## 贡献者

 *   [ cosmaut ](https://profiles.wordpress.org/cosmaut/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/cosmautdl/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://cosmaut.com/cosmautdl/sponsor/)