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
