Centralized API Data
Wordpress Plugin to fetch and store data from external APIs and show them into pages posts using shortcode.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/shirshak007/centralized-api-data/archive/refs/heads/main.zipA lightweight WordPress plugin to fetch, cache, and display external API data (JSON/HTML) with zero page-load latency.
Features
- Local MySQL Caching: Serves data instantly from the local database.
- Auto-Refresh via WP-Cron: Keeps data up to date using a configurable TTL (days).
- Interactive Tables: Built-in DataTables with search, column ordering, and multi-select filters.
- Custom Card Templates: Design custom HTML card layouts using dynamic placeholders.
- Data Manager: Inline table editing and Excel (.xlsx) import/export.
Installation
- Upload the
centralized-api-datafolder to/wp-content/plugins/. - Activate the plugin via Plugins in the WordPress admin panel.
How to Use
1. Add API Source
Go to API Sources -> Add New Source, enter your API details (URL, headers, request body, TTL), and save.
2. Configure View
Go to API Sources -> View Designer to choose between Interactive Table or Custom Card Template.
3. Add Shortcode to Page/Post
Standard View:
[cached_api_table source="your-source-slug"]
Filter by Column Value:
[cached_api_table source="your-source-slug" where="status=active"]
Limit Rows:
[cached_api_table source="your-source-slug" limit="5"]
Inline Custom HTML Template:
[cached_api_table source="your-source-slug" limit="6"]
<div class="custom-card">
<h3>{{title}}</h3>
<p>{{description}}</p>
</div>
[/cached_api_table]
Direct Content Insertion (Gutenberg & Classic Editor)
In addition to dynamic shortcodes, authors can inject raw, fully formatted HTML tables directly into any post or page for manual editing:
- Insert Button in Modal: Click the Insert Cached API Table button located above the editor toolbar.
- Instant Preview: Select any cached API source (e.g., PhD List, Scholarships, Faculty) to preview the table structure before adding it to the canvas.
- Block-Safe Injection: Converts the cached database records into clean HTML table blocks without recursive parser errors or call stack limits.
- Full Editor Control: Once inserted, authors can modify text, add custom links, delete rows, reformat column headers, or apply custom styles directly inside Gutenberg or the Classic Editor.
Shortcode Attributes
| Attribute | Required | Default | Description |
|---|---|---|---|
source |
Yes | "" |
The unique slug of the API source. |
where |
No | "" |
Filter rows by column value (e.g. col=val). |
limit |
No | 0 |
Number of items to show (0 = all). |
License
GPLv2 or later.
Releases
1 release.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.