miteshp / custom-user-table
Display a user table at a custom endpoint
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:wordpress-plugin
Requires
- antecedent/patchwork: ^2.2
- brain/monkey: ^2.6
- mockery/mockery: ^1.5
- phpunit/phpunit: ^9.0
README
A lightweight and extensible WordPress plugin that displays a remote user directory fetched from an external API via a custom frontend endpoint. Built with performance in mind using transient caching and Ajax rendering.
🚀 Features
- Custom endpoint for public-facing user directory.
- Admin settings page to configure:
- Endpoint slug
- External API URL
- Cache duration (in hours)
- Transient-based caching for performance.
- Clear cache button in admin settings.
- Ajax-ready structure for future enhancements.
- Clean OOP architecture with Composer autoloading.
📁 Folder Structure
custom-user-table/
├── composer.json
├── custom-user-table.php
├── assets/
│ └── js/
│ └── script.js
├── includes/
│ ├── helpers.php
│ └── template-functions.php
├── src/
│ ├── EndpointHandler.php
│ ├── AjaxHandler.php
│ ├── Settings.php
│ └── views/
│ ├── user-table.php
│ └── user-detail.php
└── vendor/
⚙️ Installation
Option 1: From GitHub Source
- Clone or download this repository.
- Run
composer install
to generate the autoload files. - Upload the
custom-user-table
folder to your WordPresswp-content/plugins/
directory. - Activate the plugin from the WordPress dashboard.
Option 2: Install from GitHub Release
- Go to the Releases section.
- Download the
.zip
distribution package (includesvendor/
folder). - Upload and install it via WordPress Admin > Plugins > Add New > Upload Plugin.
🔧 Configuration
After activation, go to:
Settings → User Directory
You can configure the following:
- Custom Endpoint Slug: The slug used in the frontend URL (e.g.
/user-directory/
) - API Endpoint URL: The external API to fetch users from (must return JSON)
- Cache Duration (in hours): Cache user data to improve performance
- Clear Cache: Manually flush the cached data
🌐 Frontend Access
The user table will be accessible at:
https://yoursite.com/{your-custom-slug}/
Default slug: /user-directory/
🔒 Security
- Uses
wp_nonce_field
andwp_verify_nonce
for Ajax requests. - Caches only public API data using
transients
.
🧱 Developer Notes
- Plugin follows PSR-4 autoloading via Composer.
- Organized under
CUT
namespace. - Extendable and well-commented for easy integration.
📦 Build & Distribution
To prepare a distributable plugin zip:
composer install --no-dev zip -r custom-user-table.zip custom-user-table/
Optional: You can upload the built
.zip
to GitHub under the Releases tab.
📄 License
MIT License – Feel free to use and modify.
👨💻 Author
Built by [Mitesh P]