WP Cron Fetcher WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
Generic WordPress plugin to fetch, cache and display remote content via WP-Cron
Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/wp-spaghetti/wp-cron-fetcher/releases/download/v0.2.0/wp-cron-fetcher.zipWP Cron Fetcher (WordPress Plugin)
Generic WordPress plugin to fetch, cache and display remote content via WP-Cron.
WP Cron Fetcher provides a lightweight framework for scheduling remote content fetches using WP-Cron, storing results in transients, and exposing them via shortcodes. It ships with a built-in fetcher for the Evangelizo liturgical daily feed as a reference implementation.
Features
- Extensible architecture: Register custom fetchers via the
wp_cron_fetcher_registerfilter - WP-Cron scheduling: Automatic periodic fetches with configurable schedules (hourly, daily, etc.)
- Transient caching: Fetched content is stored in WordPress transients with automatic expiration
- Shortcode support: Each fetcher can expose shortcodes to display cached content
- W3TC integration: Automatic page cache purge after successful fetches
- Fallback fetch: If a transient is missing when a shortcode is rendered, a fresh fetch is triggered automatically
- Logging: Full integration with WP Logger for debug and error tracking
- Dependency Isolation: All dependencies are scoped via wpify/scoper to prevent conflicts with other plugins
Requirements
- PHP ^8.1
- WordPress ^6.0
Installation
You can install the plugin in three ways: manually, via Composer from WP Packages, or via Composer from GitHub Releases.
Manual Installation- Go to the Releases section of this repository.
- Download the latest release zip file.
- Log in to your WordPress admin dashboard.
- Navigate to
Plugins>Add New. - Click
Upload Plugin. - Choose the downloaded zip file and click
Install Now.
If you use Composer to manage WordPress plugins, you can install it from WP Packages:
- Open your terminal.
- Navigate to the root directory of your WordPress installation.
- Ensure your
composer.jsonfile has the following configuration: *
{
"require": {
"composer/installers": "^1.0 || ^2.0",
"wp-plugin/wp-cron-fetcher": "^0.1"
},
"repositories": [
{
"name": "wp-packages",
"type": "composer",
"url": "https://repo.wp-packages.org"
}
],
"extra": {
"installer-paths": {
"wp-content/plugins/{$name}/": [
"type:wordpress-plugin"
]
}
}
}
- Run the following command:
composer update
Note:
* composer/installers might already be required by another dependency.
If you use Composer to manage WordPress plugins, you can install it from this repository directly.
Standard Version (uses WordPress update system):
- Open your terminal.
- Navigate to the root directory of your WordPress installation.
- Ensure your
composer.jsonfile has the following configuration: *
{
"require": {
"composer/installers": "^1.0 || ^2.0",
"wp-spaghetti/wp-cron-fetcher": "^0.1"
},
"repositories": [
{
"type": "package",
"package": {
"name": "wp-spaghetti/wp-cron-fetcher",
"version": "0.2.0",
"type": "wordpress-plugin",
"dist": {
"url": "https://github.com/wp-spaghetti/wp-cron-fetcher/releases/download/v0.2.0/wp-cron-fetcher.zip",
"type": "zip"
}
}
}
],
"extra": {
"installer-paths": {
"wp-content/plugins/{$name}/": [
"type:wordpress-plugin"
]
}
}
}
Version with Plugin Update Checker (uses PUC for updates via GitHub):
For installations that need updates managed via GitHub instead of WordPress.org, use the --with-puc version:
{
"require": {
"composer/installers": "^1.0 || ^2.0",
"wp-spaghetti/wp-cron-fetcher": "^0.1"
},
"repositories": [
{
"type": "package",
"package": {
"name": "wp-spaghetti/wp-cron-fetcher",
"version": "0.2.0",
"type": "wordpress-plugin",
"dist": {
"url": "https://github.com/wp-spaghetti/wp-cron-fetcher/releases/download/v0.2.0/wp-cron-fetcher--with-puc.zip",
"type": "zip"
}
}
}
],
"extra": {
"installer-paths": {
"wp-content/plugins/{$name}/": [
"type:wordpress-plugin"
]
}
}
}
- Run the following command:
composer update
Note:
* composer/installers might already be required by another dependency.
* The --with-puc version includes Plugin Update Checker for automatic update detection from GitHub releases, while the standard version relies on the WordPress.org update system.
Usage
Registering a Fetcher
WP Cron Fetcher does nothing on its own — you need to register one or more fetchers. Add this in your theme's functions.php or in a dependent plugin:
add_filter('wp_cron_fetcher_register', function (array $fetchers): array {
$fetchers[] = new \WpSpaghetti\WPCF\Fetcher\EvangelizoFetcher();
return $fetchers;
});
Built-in Shortcodes (EvangelizoFetcher)
The bundled EvangelizoFetcher provides two shortcodes:
| Shortcode | Description |
|---|---|
[evangelizo_liturgic] |
Daily liturgical title |
[evangelizo_gospel] |
Commentary + gospel title |
CSS Classes
The shortcodes output semantic HTML with CSS classes for easy styling:
/* Liturgic shortcode */
.wpcf-evangelizo-liturgic { }
/* Gospel shortcode */
.wpcf-evangelizo-gospel { }
.wpcf-evangelizo-gospel__comment { }
.wpcf-evangelizo-gospel__title { }
Creating a Custom Fetcher
Extend AbstractFetcher and implement the FetcherInterface:
use WpSpaghetti\WPCF\Fetcher\AbstractFetcher;
class MyApiFetcher extends AbstractFetcher
{
public function getId(): string
{
return 'my_api';
}
public function fetch(): void
{
$data = $this->remoteGet('https://api.example.com/data');
$this->storeTransient('data', $data);
}
public function getShortcodes(): array
{
return [
'my_api_data' => function (array $atts): string {
$data = $this->readTransient('data');
return $data ? '<div class="my-api-data">' . esc_html($data) . '</div>' : '';
},
];
}
}
Configuration
| Environment Variable | Description | Default |
|---|---|---|
WP_CRON_FETCHER_TIMEOUT |
HTTP request timeout in seconds | 10 |
Changelog
Please see CHANGELOG for a detailed list of changes for each release.
We follow Semantic Versioning and use Conventional Commits to automatically generate our changelog.
Release Process
- Major versions (1.0.0 → 2.0.0): Breaking changes
- Minor versions (1.0.0 → 1.1.0): New features, backward compatible
- Patch versions (1.0.0 → 1.0.1): Bug fixes, backward compatible
All releases are automatically created when changes are pushed to the main branch, based on commit message conventions.
Contributing
For your contributions please use:
See CONTRIBUTING for detailed guidelines.
Sponsor
License
Releases
2 releases. Each count is every asset in that release; expand a row for the breakdown.
v0.2.0
latest
Apr 8, 2026 6mo ago
wp-cron-fetcher.zip
+1 asset
6
Apr 6, 2026 6mo ago
wp-cron-fetcher.zip
+1 asset
8
Active-site estimate ≈10 comes from the median of recent superseded releases. Method.
