{"id":15292186,"url":"https://github.com/yeraph-plus/alist-client-plugin-for-wordpress","last_synced_at":"2025-07-25T20:31:47.404Z","repository":{"id":255891011,"uuid":"853822280","full_name":"yeraph-plus/alist-client-plugin-for-wordpress","owner":"yeraph-plus","description":"适用于 WordPress 的 Alist 客户端插件，转发  Alist 服务器中的文件链接到网页中。","archived":false,"fork":false,"pushed_at":"2024-10-06T18:56:11.000Z","size":309,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-15T20:41:35.949Z","etag":null,"topics":["alist","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yeraph-plus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-07T16:24:29.000Z","updated_at":"2024-10-10T14:32:06.000Z","dependencies_parsed_at":"2024-09-07T18:10:15.250Z","dependency_job_id":"f85c6ee8-ecd8-4545-a13c-604f3a74c703","html_url":"https://github.com/yeraph-plus/alist-client-plugin-for-wordpress","commit_stats":null,"previous_names":["yeraph-plus/alist-client-plugin-for-wordpress"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeraph-plus%2Falist-client-plugin-for-wordpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeraph-plus%2Falist-client-plugin-for-wordpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeraph-plus%2Falist-client-plugin-for-wordpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeraph-plus%2Falist-client-plugin-for-wordpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeraph-plus","download_url":"https://codeload.github.com/yeraph-plus/alist-client-plugin-for-wordpress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227614682,"owners_count":17793949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alist","wordpress","wordpress-plugin"],"created_at":"2024-09-30T16:16:52.852Z","updated_at":"2025-07-25T20:31:46.490Z","avatar_url":"https://github.com/yeraph-plus.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Alist 文件列表客户端插件 for WordPress\r\n\r\n\u003e **风险提示：** 此插件的上游项目 alist 被曝供应链投毒，请自行考量是否弃用。 [Source from](https://www.nodeseek.com/post-361011-1)\r\n\r\n![截图](https://github.com/yeraph-plus/alist-client-plugin-for-wordpress/blob/master/screenshot/2025-04-13%20081411.png?raw=true)\r\n\r\n使用 WordPress 短代码功能在文章中插入 Alist 服务器中的文件链接，通过 Alist 托管站点的文件下载。\r\n\r\n### 插件说明\r\n\r\n**需要 `PHP\u003e=8.1` 并包含 `curl` 和 `json` 拓展**\r\n\r\n插件使用 Alist API 实现，所有请求均在后端完成，无需担心令牌泄露。\r\n\r\n短代码功能完整支持 API 的 `get`、`list`、`search` 接口，可使用文件路径、文件夹、索引关键词方式获取 Alist 中的文件或文件列表，支持分页显示。\r\n\r\n### 使用说明\r\n\r\n各选项详细说明请见插件设置页，以下为一些需要注意的地方：\r\n\r\n1. 短代码支持使用交互表单快捷输入，但仅限经典编辑器，未适配古腾堡。\r\n\r\n2. 如果使用搜索接口，需要先为 Alist 配置数据库，否则 Alist 是不支持索引的。\r\n\r\n3. 前端使用 bootstrap-icons 图标库匹配文件图标，在站点中会额外加载图标库字体的样式表。\r\n\r\n4. 插件中设置的 Alist 服务器地址需要外部可访问，如果你的 Alist 无法从外部访问（如 `http://127.0.0.1:5244/`），请将插件链接设置改为 “提取直链”，否则插件会直接拼接为内部链接。\r\n\r\n5. 插件默认使用异步请求文件列表，异步加载时会在页面中载入额外的JS组件，可能会有部分 Pjax 形式的主题不兼容，此时可切换为同步加载，但是会拖慢页面加载速度。\r\n\r\n6. 插件默认在获取到超过10个文件时开始分页，可通过设置为0不分页，但由于 Alist 索引文件时强制要求分页参数，可在短代码中添加 `per_page=\"10\"` 参数覆盖全局设置。\r\n\r\n7. 如果配置短代码参数 `refresh=\"ture\"` ，会使 Alist 跳过自身缓存直接从网盘位置获取文件，通常不建议使用。\r\n\r\n有使用问题/功能建议请提 issue ，随缘处理。\r\n\r\n### Alist API 的封装类说明\r\n\r\n插件使用 Alist API 的所有请求方法封装在项目的 `/lib` 目录下，是根据 Alist API (V3) 实现的PHP版客户端实例。\r\n\r\n封装部分仅Alist的`auth`、`fs`、`public`这三组接口，其他的元信息、用户、设置等的功能接口外部也用不上，就没管。\r\n\r\n目录下提供了 `demo.php` 方法样例，你可以以此为参考自行实现其他功能或将 Alist 嵌入到其他PHP项目中。\r\n\r\n此实例的请求参数和返回响应与官方文档一致，具体的参数定义请参照 [Alist 文档](https://alist.nn.ci/zh/guide/api/auth.html) 。\r\n\r\n### 完整短代码参数说明\r\n\r\n#### 最简调用：\r\n\r\n`[alist_cli path=\"/\" /]`\r\n\r\n不指定方法时，默认使用`get`方法。\r\n\r\nPS：插件会通过判断传入的路径是否为文件切换到`list`方法，只是简单正则检查，不一定准。\r\n\r\n#### 文件列表：\r\n\r\n`[alist_cli method=\"list\" path=\"/\" password=\"\" per_page=\"0\" refresh=\"false\" /]`\r\n\r\n参数按顺序为插件方法、路径、访问密码、分页、强制刷新，前台使用文件列表模板。\r\n\r\n#### 文件/文件夹详情：\r\n\r\n`[alist_cli method=\"get\" path=\"/readme.md\" password=\"\" per_page=\"0\" refresh=\"false\" /]`\r\n\r\n参数按顺序为插件方法、文件\u0026文件夹路径、访问密码、分页、强制刷新，前台使用文件详情卡片模板。\r\n\r\n#### 搜索文件或文件夹：\r\n\r\n`[alist_cli method=\"search\" parent=\"/\" keywords=\"关键词\" scope=\"2\" password=\"\" per_page=\"0\" /]`\r\n\r\n参数按顺序为插件方法、搜索根路径、关键词、搜索范围、访问密码、分页，前台使用文件列表模板。\r\n\r\n使用搜索方法时列表加载更慢，这是因为 Alist 索引结果是不包含文件详细参数的，所以内部需要将列表重新循环为`get`方法以获取文件。\r\n\r\n#### 直接输出文件真实地址：\r\n\r\n`[alist_raw_url path=\"/readme.md\" /]`\r\n\r\n用于嵌入网页播放器。~~但是播放器插件是不打算写了。~~\r\n\r\n### 加载速度优化参考\r\n\r\n因为通常的 Alist 站点都会使用cf加速，并且插件是通过 Curl 发送外部请求的，所以直接在服务器配置DNS解析到 Alist 服务器，可以加速加载速度，或者在 Nginx 配置条件反向代理到 Alist 也行。\r\n\r\n### ~~在线要饭~~\r\n\r\n赏赏作者，支持一下：[我的爱发电](https://afdian.com/a/NyaaACG)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeraph-plus%2Falist-client-plugin-for-wordpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeraph-plus%2Falist-client-plugin-for-wordpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeraph-plus%2Falist-client-plugin-for-wordpress/lists"}