| 开发者 | whoknewio |
|---|---|
| 更新时间 | 2026年6月8日 05:00 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv3 |
| 版权网址: | 版权信息 |
sermons slug; the category is created if missing), organizing them by speaker, scripture, and series, and detecting when you go live so your website can show the stream in real time.
What It Does
Automatic Sermon Import
Connect your YouTube channel once. The plugin pulls videos from your channel’s uploads playlist using playlistItems.list (not search.list), then creates WordPress posts with title, description, thumbnail, and publish date from YouTube. New sermons can appear on your site automatically — no manual entry, no copy-paste, no volunteer hours wasted.
Smart Title Parsing
Designed for real church naming conventions. The parser extracts sermon title, speaker name, scripture reference, Bible book, and series name from your video titles automatically. Other churches may need naming consistency or parser tuning over time.
Live Stream Detection
When your service starts, your website can know. The live detector uses a two-request pattern (playlistItems.list + videos.list, up to 2 API quota units when the server actually refreshes live status from YouTube), only inside configurable windows around your Service Times. Outside those windows, no YouTube calls are made for live status (and cached answers may use 0 units). Results are cached in a transient (shorter TTL while live). The stream UI can switch when service ends — no volunteer flipping a switch.
Quota-Conscious YouTube API Design
Your API quota is treated as a resource to steward. Imports use the uploads playlist pattern above; live checks avoid hammering the API and include guards such as actualEndTime so finished broadcasts are not mistaken for live. The REST live-status endpoint supports a rate-limited refresh and sends Cache-Control: no-store so CDNs and browsers do not cache stale “live” states.
Filterable Sermon Archive
Visitors can filter your sermon library by speaker, Bible book, series, and year. The archive works with popular WordPress themes and search plugins out of the box.
Speaker, Book & Series Taxonomies
Sermons are organized into custom taxonomies on the post type (servantly_si_sermon_speaker, servantly_si_sermon_book, servantly_si_sermon_series), REST-visible, with rewrite slugs sermon-speaker, sermon-book, sermon-series. Bulk & titles merges duplicate terms and can optionally map YouTube titles split by a delimiter to sermon fields on import.
Curated Content Protection
Lock individual sermon posts to prevent auto-import from overwriting your manual edits. The importer skips creating duplicates when sermon_video_id already exists. Unlocked posts can be refreshed on re-import; locked posts (_sermon_locked) are not overwritten.
Service Times Configuration
Configure your recurring service times once. The plugin uses them to gate live detection, power the homepage countdown to next service, and give visitors accurate schedule context.
Homepage Sermon Hero
The [servantly_latest_sermon] shortcode outputs a sermon hero — latest sermon embed, countdown to next service, live detection, and a grid of recent messages. Optional shortcode attributes: label (eyebrow text), sermons_url (defaults to home_url( '/sermons/' ) — your site’s front URL plus the /sermons/ path; override if your archive lives elsewhere).
Watch Online Page
The [servantly_watch] shortcode creates a Watch Online experience: live embed when streaming (with a LIVE treatment), otherwise latest sermon, plus a recent grid. Hero “Play Now” and live links resolve to Settings → Watch online page URL when set, otherwise the most recently updated published page/post that contains [servantly_watch], otherwise home_url( '/watch/' ). Optional shortcode attribute watch_url on [servantly_latest_sermon] overrides per hero. Front-end JavaScript can swap the player without a full page reload when status changes.
Admin Screen (Sermon Importer)
The plugin adds a single admin menu, Sermon Importer, with tabs (not separate submenus):
page-sermons.php supplied by the plugin) for the page that should render the full archive experience.[servantly_latest_sermon] and [servantly_watch] as described above. Styles and scripts live under the plugin’s assets/ directory.servantly-si/v1 (public by design for the archive and watch UI):
GET /wp-json/servantly-si/v1/sermons — Paginated sermons with query args such as speaker, book, series, year, sort, page.GET /wp-json/servantly-si/v1/filters — Filter option payloads for the UI.GET /wp-json/servantly-si/v1/live-status — Live/offline payload; optional refresh respects a short server-side cooldown.Cache-Control: no-store so caching layers do not serve stale live states.
Caching Plugin Compatibility
When auto-import runs via WP-Cron and creates new sermon posts, the plugin automatically purges the page cache across all major caching plugins and hosting environments — but only when new posts are actually created (imports that find nothing new never touch the cache).
Supported out of the box (no configuration needed):
servantly_si_after_cache_purge action to add your own purge call:
add_action( 'servantly_si_after_cache_purge', 'my_custom_cache_purge' );
Comments & Pings
Configurable. Under Sermon Importer → Settings → Comments & discussions, choose whether WordPress should leave comments alone (default), disable them only on sermon posts (posts in the Sermons category or with a stored YouTube sermon_video_id), or disable them sitewide (and hide the Comments admin menu / admin bar node — the original single-purpose church behavior). No option deletes existing comment rows; sitewide or sermon-only modes simply prevent new comments/pings where applied.
Customizing for Another Church
Functionally you need your own YouTube channel ID, API key, and service times. Shortcode names use the original plugin slug for backward compatibility; title parsing is tuned for common church patterns — adjust YouTube titles or extend parsing if your naming differs.
Who This Is For
Any church or ministry that:
[servantly_latest_sermon] shortcodephpcs.xml.dist in the plugin root (next to servantly-sermon-importer.php) in source control — it is omitted from distribution ZIPs built for upload. With PHP_CodeSniffer available in your environment, from a checkout of that directory run phpcs (or phpcs --standard=phpcs.xml.dist).
Also Recommended
Protect your church website's contact information. Staff email addresses, office phone numbers, and your building's physical address are harvested by spam bots every day — the same bots that enable phishing attacks, robocalls, and junk mail. WhoKnew Shield™ protects all of it automatically, with zero configuration. Free version available.
More Free Tools for Nonprofits & Ministries
This plugin is part of the Servantly suite — free, open-source WordPress plugins built for nonprofit organizations and ministries. For more information and additional free software, visit servantly.org.
Credits
WhoKnew.io — whoknew.io
servantly-sermon-importer folder (the one that contains servantly-sermon-importer.php alongside readme.txt, includes/, assets/, etc.) to /wp-content/plugins/. If a ZIP wraps that folder in an extra parent directory, use the inner folder that contains the main plugin PHP file.sermons_url on the hero defaults to home_url( '/sermons/' ) unless overridden. Put [servantly_watch] on your Watch page (any slug); the hero finds it automatically, or set Watch online page URL in Settings. Add [servantly_latest_sermon] on your homepage (or any hero page).channels.list call.
Yes. The plugin is running at Calvary Chapel Lake Arrowhead. See the sermon archive, the Watch Online page, and the homepage sermon hero shortcode in action.
A YouTube Data API v3 API key created in Google Cloud Credentials (Create credentials → API key). You do not need OAuth, a “Web application” client ID, or a Google Sign-In flow — those are for a different kind of integration. Restrict the key to YouTube Data API v3 under API restrictions; see Installation for application restrictions (avoid HTTP referrers).
It is almost always UC plus 22 more characters (24 total), no spaces. In YouTube Studio: Settings → Channel → Advanced settings → Channel ID. Google’s help: Find your YouTube user & channel IDs.
Import latest (and Auto-Import) only fetch the newest batch of videos from your uploads playlist — the same cap shown on the Import tab — so routine updates stay fast and light on quota. Import full channel walks the entire uploads playlist from newest to oldest until the end, which is ideal for a first-time backfill but uses more quota because YouTube charges one quota unit per playlist page (up to 50 videos per page). Standard UC… channel IDs also avoid an extra channels.list call when resolving the uploads playlist.
Google’s default free quota for the YouTube Data API is 10,000 units per day per project (Google may change policy; check your Cloud Console Quotas page). Units are not “sermons” — each playlistItems.list or videos.list request typically costs 1 unit; channels.list is 1 unit when needed (non-standard channel IDs).
Imports: roughly 1 unit per 50 videos listed from the uploads playlist (each API page). A latest run only pulls a capped number of recent videos. Auto-Import uses that same recent-only scope on your schedule.
Live detection: when the site actually hits YouTube during a service-time window, one refresh uses playlistItems + videos.list = up to 2 units. Outside those windows the plugin does not poll YouTube for live status; cached responses may use 0 additional units.
For a typical church schedule, 10,000 units/day is plenty if you use latest imports day-to-day and only run full when you mean to. If something spikes (quota errors, quotaExceeded in JSON), open Sermon Importer → API log to see the exact reason.
By design. Live status is only checked during windows built from your Service Times (before start, during expected length, and a few minutes after). Outside those windows the site does not call YouTube for live checks — that saves quota and avoids pointless API traffic. The Watch UI still works; it simply will not “discover” live until a window is active (or a cached live state is still valid).
Recent failures from the YouTube Data API and related import steps: time, HTTP status, context (e.g. which API method), error code, a human-readable message, and an expandable JSON response body when available so you can read Google’s reasons (quotaExceeded, keyInvalid, etc.). API keys are redacted in stored text (key=***), so you can share a screenshot with support without leaking your secret.
Yes. Any church or ministry with a YouTube channel can use this plugin. It works with standard UC… channel IDs and can resolve uploads playlist identifiers for the importer when the ID format needs a channels.list lookup.
Yes. Use Import full channel on the Import tab to scan your channel’s entire uploads playlist. Depending on how many videos you have, the first run may take a while and will use more quota than day-to-day latest runs. After the backfill, use Auto-Import or Import latest for new uploads.
WP-Cron runs once per hour. If auto-import is enabled and the current day and hour match your configured slots (up to two hours per day), the plugin runs a recent-only import (capped batch size), not a full historical rescan.
The title parser expects common sermon title patterns. Videos that do not match well still import as posts — you can lock or delete them from the Manage Sermons tab.
Yes. Lock any sermon post from the Manage Sermons tab. Locked posts are not overwritten by import. Unlocked posts can be refreshed when you re-import.
The plugin targets compatibility with common WordPress themes (including Storefront, Divi, and many Elementor-built sites). For the archive layout, assign the Sermon Archive page template to your sermons page in the editor. Advanced users can still override via a child theme if needed.
Use Sermon Importer → Bulk & titles to merge duplicate taxonomy terms. On the same tab you can enable a custom title split (delimiter + part-to-field map) when your channel uses a consistent pattern different from the built-in parser.
No paid Sermon Importer tier exists. This plugin is completely free for all sermon and archive features, with no feature locks. It was built for our church and given to the church community at no cost.
By default they are not — Sermon Importer → Settings → WordPress comments is set to “Do not change comments.” If you choose “Disable sitewide,” then comments and pings are closed everywhere while that option is saved (and the Comments screen is hidden). Pick “Sermon posts only” if you want blog or page comments but not on imported sermons.
purge_post_cache() was calling sg_cachepress_purge_cache() with no arguments and firing breeze_clear_all_cache on every single sermon save, which flushed the entire site cache (including the homepage) instead of only the saved sermon's page. Both calls now pass the specific post URL so only that page is invalidated.background-size: cover and background-position: center to .servantly-card__thumb so server-rendered cards in the Most Recent Sermons strip continue to display thumbnails correctly.background-image to <img loading="lazy"> so images off-screen are deferred by the browser instead of all firing simultaneously, which was causing images to fail silently on slower connections or after multiple Load More clicks.Cache-Control: no-store response headers to the /sermons and /filters REST endpoints to prevent server-side and CDN caches (e.g. SiteGround SuperCacher) from storing empty responses and serving "No sermons found" to visitors..servantly-res-drawer__body so ccla-* and servantly-desc__* formatting applies correctly inside the resource drawer after it is portaled to <body>.border-left green stripe from the resource drawer caused by the base description container styles being applied to the drawer context..servantly-desc__section-label, .servantly-desc__takeaways, .servantly-desc__takeaway, .servantly-desc__check, .servantly-desc__bullets, .servantly-desc__highlight) for structured, high-end sermon notes and summaries.[servantly_latest_sermon]) now transitions out of "live" state dynamically — no page reload, no manual cache clearing required. When the stream ends, the hero smoothly restores the latest sermon title, thumbnail, scripture, and speaker using sermon data embedded in the page at render time. The live banner and countdown are always present in the HTML and toggled by JavaScript, eliminating the previous behavior where a full-page cache could keep the hero stuck showing "Streaming Live Now" until the cache was manually cleared.