Title: WP Github Commits
Author: Sudar Muthu
Published: <strong>2013 年 2 月 12 日</strong>
Last modified: 2021 年 10 月 13 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/wp-github-commits.svg)

# WP Github Commits

 作者：[Sudar Muthu](https://profiles.wordpress.org/sudar/)

[下载](https://downloads.wordpress.org/plugin/wp-github-commits.0.6.zip)

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

 [支持](https://wordpress.org/support/plugin/wp-github-commits/)

## 描述

Displays the latest commits of a github repo in the sidebar.

### Features

#### Sidebar Widget

The Plugin provides a sidebar widget which can be configured to display commits 
from a github repo in the sidebar. You can have multiple widgets with different 
repo configured for each one of them.

#### Template function

In addition to using the widget, you can also use the following template function
to display the commits of a github repo, anywhere in the theme

    ```
    get_github_commits($user, $repo, $count);
    ```

The following options can be passed in the `$options` array

 * `$user` (string) – Github user name.
 * `$repo` (string) – Github repo name.
 * `$count` (int) – default 5 – Number of recent commits to show

#### Custom field

You can also specify the repo for each post or page as a custom field. You can add
it under the “WP Github Commits Page fields” section in the Add/Edit post screen.

#### Caching

The Plugin caches the commits that is retrieved from Github for 5 hours.

#### Styling using CSS

The Plugin adds the following CSS classes. If you want to customize the look of 
the widget then can change it by adding custom styles to these CSS classes.

 * The outer `ul` tag has the class `github-commits`
 * Every `li` tag has the class `github-commit`

### Troubleshooting

If you get timeouts or the error “WP HTTP Error: name lookup timed out” then it 
means that your server is not timing out before github can respond.

You can use the code from [this gist](https://gist.github.com/sudar/4945588) to 
increase the timeout.

### Translation

The pot file is available with the Plugin. If you are willing to do translation 
for the Plugin, use the pot file to create the .po files for your language and let
me know. I will add it to the Plugin after giving credit to you.

### Development

The development of the Plugin happens over at [github](https://github.com/sudar/wp-github-commits).
If you want to contribute to the Plugin, fork the [project at github](https://github.com/sudar/wp-github-commits)
and send me a pull request.

If you are not familiar with either git or Github then refer to this [guide to see how fork and send pull request](http://sudarmuthu.com/blog/contributing-to-project-hosted-in-github).

If you are looking for ideas, then you can start with one of the following TODO 
items 🙂

### TODO

 * Shortcode support
 * Ability to hide author name
 * Make the output of widget content plugable

### Support

 * If you have found a bug/issue or have a feature request, then post them in [github issues](https://github.com/sudar/wp-github-commits/issues)
 * If you have a question about usage or need help to troubleshoot, then post in
   WordPress forums or leave a comment in [Plugins’s home page](http://sudarmuthu.com/wordpress/wp-github-commits)
 * If you like the Plugin, then kindly leave a review/feedback at [WordPress repo page](https://wordpress.org/extend/plugins/wp-github-commits/).
 * If anything else, then contact me in [twitter](http://twitter.com/sudarmuthu).

### Stay updated

I would be posting updates about this Plugin in my [blog](http://sudarmuthu.com/blog)
and in [Twitter](http://twitter.com/sudarmuthu). If you want to be informed when
new version of this Plugin is released, then you can either subscribe to this [blog’s RSS feed](http://sudarmuthu.com/feed)
or [follow me in Twitter](http://twitter.com/sudarmuthu).

Also checkout the [other WordPress Plugins](http://sudarmuthu.com/wordpress) that
I have created.

### Readme Generator

This Readme file was generated using [wp-readme](http://sudarmuthu.com/wordpress/wp-readme),
which generates readme files for WordPress Plugins.

## 安装

The simplest way to install the plugin is to use the built-in automatic plugin installer.
Go to plugins -> Add New and then enter the name of the plugin to automatically 
install it.

If for some reason the above method doesn’t work then you can download the plugin
as a zip file, extract it and then use your favorite FTP client and then upload 
the contents of the zip file to the wp-content/plugins/ directory of your WordPress
installation and then activate the Plugin from Plugins page.

## 评价

此插件暂无评价。

## 贡献者及开发者

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

贡献者

 *   [ Sudar Muthu ](https://profiles.wordpress.org/sudar/)

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

### 对开发感兴趣吗?

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

## 更新日志

#### v0.6 – (2016-11-13) – (Dev Time: 0.5 hour)

 * Tweak: Trimmed commit messages to 30 characters

#### v0.5 – (2013-04-24) – (Dev Time: 1 hour)

 * Tweak: Added documentation

#### v0.4 – (2013-02-16) – (Dev Time: 1 hour)

 * New: Generated pot file for translation
 * Tweak: Changed custom field names to make it compatible with other Plugins

#### v0.3 – (2013-02-14) – (Dev time: 1 hour)

 * Tweak: Use custom field for widget title only if it non-blank
 * Tweak: Formatted the date into a human readable format

#### v0.2 – (2013-02-13) – (Dev time: 1 hour)

 * New: Added option to take repo name from custom field in a post

#### v0.1 – (2013-02-11) – (Dev time: 3 hour)

 * Initial Release

## 额外信息

 *  版本 **0.6**
 *  最后更新：**5 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3.5 或更高版本 **
 *  已测试的最高版本为 **5.8.13**
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-github-commits/)
 * 标签
 * [commits](https://cn.wordpress.org/plugins/tags/commits/)[Github](https://cn.wordpress.org/plugins/tags/github/)
   [widget](https://cn.wordpress.org/plugins/tags/widget/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-github-commits/advanced/)

## 评级

 4.5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/wp-github-commits/reviews/?filter=5)
 *  [  1 条 4 星评价     ](https://wordpress.org/support/plugin/wp-github-commits/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/wp-github-commits/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/wp-github-commits/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/wp-github-commits/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-github-commits/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-github-commits/reviews/)

## 贡献者

 *   [ Sudar Muthu ](https://profiles.wordpress.org/sudar/)

## 支持

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

 [查看支持论坛](https://wordpress.org/support/plugin/wp-github-commits/)