RSS feed functionality for OpenPub
This plugin provides RSS 2.0 and Atom 1.0 feed functionality for OpenPub portal sites. It fetches items from a configured OpenPub API source and generates standards-compliant feeds with images, categories, and caching.
- Dual feed formats: RSS 2.0 at
/rss.xmland Atom 1.0 at/atom.xml - Rich metadata: Full HTML content, categories, images as enclosures
- Smart caching: Server-side transient caching + HTTP cache headers (configurable TTL)
- Portal detection: Only serves feeds when "openpub api url" is configured (
options_openpub_api_urlhas a value) - Native WordPress: Uses Settings API, no external dependencies
- Network-safe: Can be activated network-wide, gracefully does nothing without configuration
- PHP 7.4 or higher
- WordPress 5.0 or higher
- OpenPub API URL configured in
options_openpub_api_url
- Clone or download this repository to your WordPress plugins directory
- Run
composer installto install dependencies, only needed for development, for WP Coding Standards - Activate the plugin through the WordPress admin interface, or with WP-CLI:
wp plugin activate openpub-rss --network - Configure settings at Settings → OpenPub RSS
Navigate to Settings → OpenPub RSS to configure:
- Feed Title: Title of your RSS feed (default: site name)
- Feed Description: Brief description of your feed (default: site tagline)
- Items Per Feed: Maximum items to include (1-100, default: 20)
- Include Images: Include images as enclosures (default: enabled)
- Cache Duration: Transient and HTTP cache TTL in minutes (1-1440, default: 15)
Once configured, your feeds will be available at:
- RSS 2.0:
https://yoursite.com/rss.xml - Atom 1.0:
https://yoursite.com/atom.xml
The plugin uses a two-tier caching strategy:
- Server-side: WordPress transients cache API responses (configurable TTL)
- Client-side: HTTP headers (
Cache-Control,Expires) match the transient TTL
This reduces server load and API calls while ensuring feeds stay fresh.
The plugin uses WordPress rewrite rules to handle /rss.xml and /atom.xml URLs. If you're getting a 404 error:
- Deactivate and reactivate the plugin - This automatically flushes rewrite rules
- Or manually flush: Go to Settings → Permalinks and click "Save Changes" (you don't need to change anything)
- Or use WP-CLI:
wp rewrite flush
The plugin automatically flushes rewrite rules on activation and deactivation, but if you're still having issues, one of these methods should resolve it.
Run PHP CodeSniffer to check code quality:
composer install
./vendor/bin/phpcsGPL-3.0-or-later
Developed by Acato for the OpenWebconcept community.