GitHub Users Endpoint
A WordPress plugin providing a configurable REST API endpoint that returns selected user directory data in JSON.
by WordPress.com Special Projects · github.com/a8cteam51/github-users-endpoint
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/a8cteam51/github-users-endpoint/archive/refs/heads/trunk.zipGitHub Users Endpoint WordPress Plugin
A WordPress plugin that provides a public REST API endpoint to expose GitHub organization member data (usernames, names, and avatars) in JSON format.
Description
This plugin allows external applications or websites to easily access and display GitHub team member information without directly integrating with GitHub's API. It includes caching to avoid API rate limits and provides an admin interface for easy configuration.
Features
- Public REST API Endpoint: Accessible at
/wp-json/github-users/v1/members - GitHub Integration: Uses GitHub Personal Access Token for authentication
- Organization Selection: Choose from organizations you have access to
- Automatic Caching: Configurable cache intervals to avoid API rate limits
- Admin Interface: Easy setup and management through WordPress admin
- Error Handling: Comprehensive error handling and user feedback
- Rate Limit Protection: Graceful handling of GitHub API rate limits
Installation
- Upload the plugin files to
/wp-content/plugins/github-users-endpoint/ - Activate the plugin through the 'Plugins' menu in WordPress
- Go to Settings > GitHub Users to configure the plugin
Configuration
1. Create a GitHub Personal Access Token
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click "Generate new token (classic)"
- Give it a descriptive name (e.g., "WordPress GitHub Users Endpoint")
- Select the
read:orgscope (required to access organization member lists) - Click "Generate token" and copy the token
2. Configure the Plugin
- In WordPress admin, go to Settings > GitHub Users
- Enter your GitHub Personal Access Token
- Click "Test Connection" to verify your token works
- Select your organization from the dropdown
- Configure the cache interval (default: 1 hour)
- Save settings
API Usage
Endpoint
GET /wp-json/github-users/v1/members
Response Format
The endpoint returns a JSON array of GitHub users:
[
{
"username": "username",
"name": "Full Name",
"avatar": "https://avatars.githubusercontent.com/u/12345?v=4"
}
]
Caching
The plugin caches GitHub user data to avoid hitting API rate limits. The cache is automatically updated based on the configured interval (default: 1 hour).
Troubleshooting
Common Issues
"Connection failed" Error
- Verify your GitHub token is correct
- Ensure the token has the
read:orgscope - Check if the token has expired
"No organizations found" Error
- Verify your GitHub account has access to organizations
- Ensure your token has the
read:orgscope - Check if you're a member of any organizations
Empty Response from API
- Verify the organization name is correct
- Check if the organization has any public members
- Ensure your token has access to the organization
Rate Limit Errors
- The plugin automatically handles rate limits by using cached data
- Increase the cache interval to reduce API calls
- Check your GitHub API rate limit status
Changelog
Version 1.0.0
- Initial release
- GitHub API integration
- Caching system
- Admin interface
- REST API endpoint
- Comprehensive error handling