Plugin Update Checker
=====================
This is a custom update checker library for WordPress plugins and themes. It lets you add automatic update notifications and one-click upgrades to your commercial plugins, private themes, and so on. All you need to do is put your plugin/theme details in a JSON file, place the file on your server, and pass the URL to the library. The library periodically checks the URL to see if there's a new version available and displays an update notification to the user if necessary.
From the users' perspective, it works just like with plugins and themes hosted on WordPress.org. The update checker uses the default upgrade UI that is familiar to most WordPress users.
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**
- [Getting Started](#getting-started)
- [Self-hosted Plugins and Themes](#self-hosted-plugins-and-themes)
- [How to Release an Update](#how-to-release-an-update)
- [Notes](#notes)
- [GitHub Integration](#github-integration)
- [How to Release an Update](#how-to-release-an-update-1)
- [Notes](#notes-1)
- [BitBucket Integration](#bitbucket-integration)
- [How to Release an Update](#how-to-release-an-update-2)
- [GitLab Integration](#gitlab-integration)
- [How to Release an Update](#how-to-release-an-update-3)
- [Resources](#resources)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Getting Started
---------------
### Self-hosted Plugins and Themes
1. Download [the latest release](https://github.com/YahnisElsts/plugin-update-checker/releases/latest) and copy the `plugin-update-checker` directory to your plugin or theme.
2. Go to the `examples` subdirectory and open the .json file that fits your project type. Replace the placeholder data with your plugin/theme details.
- Plugin example:
```json
{
"name" : "Plugin Name",
"version" : "2.0",
"download_url" : "http://example.com/plugin-name-2.0.zip",
"sections" : {
"description" : "Plugin description here. You can use HTML."
}
}
```
This is a minimal example that leaves out optional fields. See [this table](https://docs.google.com/spreadsheets/d/1eOBbW7Go2qEQXReOOCdidMTf_tDYRq4JfegcO1CBPIs/edit?usp=sharing&authkey=CK7h9toK&output=html) for a full list of supported fields and their descriptions.
- Theme example:
```json
{
"version": "2.0",
"details_url": "http://example.com/version-2.0-details.html",
"download_url": "http://example.com/example-theme-2.0.zip"
}
```
This is actually a complete example that shows all theme-related fields. `version` and `download_url` should be self-explanatory. The `details_url` key specifies the page that the user will see if they click the "View version 1.2.3 details" link in an update notification.
3. Upload the JSON file to a publicly accessible location.
4. Add the following code to the main plugin file or to the `functions.php` file:
```php
require 'path/to/plugin-update-checker/plugin-update-checker.php';
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
'http://example.com/path/to/details.json',
__FILE__,
'unique-plugin-or-theme-slug'
);
```
Note: If you're using the Composer autoloader, you don't need to explicitly `require` the library.
#### How to Release an Update
Change the `version` number in the JSON file and make sure that `download_url` points to the latest version. Update the other fields if necessary. Tip: You can use [wp-update-server](https://github.com/YahnisElsts/wp-update-server) to automate this process.
By default, the library will check the specified URL for changes every 12 hours. You can force it to check immediately by clicking the "Check for updates" link on the "Plugins" page (it's next to the "Visit plugin site" link). Themes don't have that link, but you can also trigger an update check like this:
1. Install [Debug Bar](https://srd.wordpress.org/plugins/debug-bar/).
2. Click the "Debug" menu in the Admin Bar (a.k.a Toolbar).
3. Open the "PUC (your-slug)" panel.
4. Click the "Check Now" button.
#### Notes
- The second argument passed to `buildUpdateChecker` must be the absolute path to the main plugin file or any file in the theme directory. If you followed the "getting started" instructions, you can just use the `__FILE__` constant.
- The third argument - i.e. the slug - is optional but recommended. In most cases, the slug should be the same as the name of your plugin directory. For example, if your plugin lives in `/wp-content/plugins/my-plugin`, set the slug to `my-plugin`. If the slug is omitted, the update checker will use the name of the main plugin file as the slug (e.g. `my-cool-plugin.php` → `my-cool-plugin`). This can lead to conflicts if your plugin has a generic file name like `plugin.php`.
This doesn't affect themes because PUC uses the theme directory name as the default slug. Still, if you're planning to use the slug in your own code - e.g. to filter updates or override update checker behaviour - it can be a good idea to set it explicitly.
### GitHub Integration
1. Download [the latest release](https://github.com/YahnisElsts/plugin-update-checker/releases/latest) and copy the `plugin-update-checker` directory to your plugin or theme.
2. Add the following code to the main plugin file or `functions.php`:
```php
require 'plugin-update-checker/plugin-update-checker.php';
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
'https://github.com/user-name/repo-name/',
__FILE__,
'unique-plugin-or-theme-slug'
);
//Optional: If you're using a private repository, specify the access token like this:
$myUpdateChecker->setAuthentication('your-token-here');
//Optional: Set the branch that contains the stable release.
$myUpdateChecker->setBranch('stable-branch-name');
```
3. Plugins only: Add a `readme.txt` file formatted according to the [WordPress.org plugin readme standard](https://wordpress.org/plugins/about/readme.txt) to your repository. The contents of this file will be shown when the user clicks the "View version 1.2.3 details" link.
#### How to Release an Update
This library supports a couple of different ways to release updates on GitHub. Pick the one that best fits your workflow.
- **GitHub releases**
Create a new release using the "Releases" feature on GitHub. The tag name and release title don't matter. The description is optional, but if you do provide one, it will be displayed when the user clicks the "View version x.y.z details" link on the "Plugins" page. Note that PUC ignores releases marked as "This is a pre-release".
- **Tags**
To release version 1.2.3, create a new Git tag named `v1.2.3` or `1.2.3`. That's it.
PUC doesn't require strict adherence to [SemVer](http://semver.org/). These are all valid tag names: `v1.2.3`, `v1.2-foo`, `1.2.3_rc1-ABC`, `1.2.3.4.5`. However, be warned that it's not smart enough to filter out alpha/beta/RC versions. If that's a problem, you might want to use GitHub releases or branches instead.
- **Stable branch**
Point the update checker at a stable, production-ready branch:
```php
$updateChecker->setBranch('branch-name');
```
PUC will periodically check the `Version` header in the main plugin file or `style.css` and display a notification if it's greater than the installed version.
Caveat: If you set the branch to `master` (the default), the update checker will look for recent releases and tags first. It'll only use the `master` branch if it doesn't find anything else suitable.
#### Notes
The library will pull update details from the following parts of a release/tag/branch:
- Version number
- The "Version" plugin header.
- The latest GitHub release or tag name.
- Changelog
- The "Changelog" section of `readme.txt`.
- One of the following files:
CHANGES.md, CHANGELOG.md, changes.md, changelog.md
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件v2.5.28.zip
共327个文件
php:147个
json:51个
po:28个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 110 浏览量
2022-03-28
19:21:58
上传
评论
收藏 921KB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件v2.5.28 WordPress Real Thumbnail Generator: Efficiently force regenerate thumbnails in bulk (or single) WordPress Real Thumbnail Generator:有效地强制批量重新生成缩略图(或单身)" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件v2.5.28.zip (327个子文件)
Additional legal information 475B
admin.css 150KB
puc-debug-bar.css 1KB
welcome.css 760B
feedback.css 649B
cross.css 375B
helper.css 191B
vendor-admin.pro.js 317KB
react-dom.production.min.js 116KB
vue-2.5.16.min.js 84KB
mobx.umd.min.js 56KB
admin.pro.js 50KB
vendor-index.js 25KB
index-prod.umd.js 24KB
index.js 19KB
feedback.js 15KB
react.production.min.js 12KB
credentials.js 10KB
welcome.js 9KB
credentials-transpiled.js 9KB
cross.js 6KB
helper.js 3KB
debug-bar.js 2KB
index.js 43B
installed.json 12KB
real-thumbnail-generator-de_CH_informal-f2de4b7ea689b532ad3d6b272c415ffa.json 8KB
real-thumbnail-generator-de_CH_informal-c91875d9a473ce379744e0a18157e404.json 8KB
real-thumbnail-generator-de_DE_formal-f2de4b7ea689b532ad3d6b272c415ffa.json 8KB
real-thumbnail-generator-de_DE_formal-c91875d9a473ce379744e0a18157e404.json 8KB
real-thumbnail-generator-de_AT-f2de4b7ea689b532ad3d6b272c415ffa.json 8KB
real-thumbnail-generator-de_CH-f2de4b7ea689b532ad3d6b272c415ffa.json 8KB
real-thumbnail-generator-de_DE-f2de4b7ea689b532ad3d6b272c415ffa.json 8KB
real-thumbnail-generator-de_DE-c91875d9a473ce379744e0a18157e404.json 8KB
real-thumbnail-generator-de_CH-c91875d9a473ce379744e0a18157e404.json 8KB
real-thumbnail-generator-de_AT-c91875d9a473ce379744e0a18157e404.json 8KB
package.json 6KB
real-utils-ru_RU-74ccc0603b454665ba4060550b4e9aa0.json 6KB
package.json 5KB
package.json 5KB
package-lock.json 3KB
composer.json 3KB
real-utils-de_DE_formal-74ccc0603b454665ba4060550b4e9aa0.json 3KB
real-utils-de_CH_informal-74ccc0603b454665ba4060550b4e9aa0.json 2KB
real-utils-de_DE-74ccc0603b454665ba4060550b4e9aa0.json 2KB
real-utils-de_AT-74ccc0603b454665ba4060550b4e9aa0.json 2KB
real-utils-de_CH-74ccc0603b454665ba4060550b4e9aa0.json 2KB
composer.json 2KB
composer.json 2KB
plugin.json 2KB
real-utils-ru_RU-61a60894c517b346c6b99608ccce350d.json 1KB
package.json 976B
composer.json 686B
real-utils-de_DE_formal-61a60894c517b346c6b99608ccce350d.json 623B
real-utils-ru_RU-bd8f888d3790e3faf824d6fd69319a28.json 617B
real-utils-de_CH_informal-61a60894c517b346c6b99608ccce350d.json 611B
real-utils-de_DE-61a60894c517b346c6b99608ccce350d.json 602B
real-utils-de_CH-61a60894c517b346c6b99608ccce350d.json 602B
real-utils-de_AT-61a60894c517b346c6b99608ccce350d.json 602B
composer.json 598B
real-utils-ru_RU-b3c66931a03e39a842384fb81443cb05.json 567B
real-utils-de_CH_informal-bd8f888d3790e3faf824d6fd69319a28.json 362B
real-utils-de_DE_formal-bd8f888d3790e3faf824d6fd69319a28.json 360B
real-utils-de_CH_informal-b3c66931a03e39a842384fb81443cb05.json 357B
real-utils-de_DE_formal-b3c66931a03e39a842384fb81443cb05.json 355B
real-utils-de_CH-bd8f888d3790e3faf824d6fd69319a28.json 353B
real-utils-de_AT-bd8f888d3790e3faf824d6fd69319a28.json 353B
real-utils-de_DE-bd8f888d3790e3faf824d6fd69319a28.json 353B
real-utils-de_CH-b3c66931a03e39a842384fb81443cb05.json 348B
real-utils-de_AT-b3c66931a03e39a842384fb81443cb05.json 348B
real-utils-de_DE-b3c66931a03e39a842384fb81443cb05.json 348B
theme.json 145B
i18n-dependency-map-undefined.json 2B
i18n-dependency-map-others.json 2B
i18n-dependency-map-default-pro.json 2B
i18n-dependency-map-default-lite.json 2B
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
LICENSE 715B
LICENSE 694B
LICENSE 689B
composer.lock 92KB
composer.lock 92KB
composer.lock 89KB
composer.lock 2KB
admin.css.map 188KB
admin.pro.js.map 157KB
index-prod.umd.js.map 120KB
index.js.map 87KB
feedback.js.map 65KB
welcome.js.map 46KB
cross.js.map 24KB
helper.js.map 11KB
welcome.css.map 1KB
feedback.css.map 1KB
cross.css.map 765B
helper.css.map 398B
LICENSE_3RD_PARTY_JS.md 171KB
共 327 条
- 1
- 2
- 3
- 4
资源评论
Lee达森
- 粉丝: 1518
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功