VC Briefly
WordPress plugin for AI-powered post summaries - smart excerpts with caching, instead of blunt text trimming.
by Vanilla Core · github.com/vanilla-core/vc-briefly · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/vanilla-core/vc-briefly/archive/refs/heads/main.zipReadme
VC Briefly
WordPress plugin for AI-powered post summaries — smart excerpts with caching, instead of blunt text trimming.
VC Briefly generates plain-text summaries of post content for themes, carousels, cards, and builders. Use it wherever you would normally call wp_trim_words() or slice strings by character count.
Repository: Vanilla-Core/vc-briefly
Features
- Theme helpers:
vc_briefly()(return) andvc_the_briefly()(echo) - Hash-keyed database cache — same content + length + language + model reuse one summary
- Providers: Gemini (free-tier demo), OpenAI, Anthropic (bring your own API keys)
- Silent trim fallback if AI is unavailable — themes never break
- Shortcode, Gutenberg block, and REST field
- Per-post admin list of cached summaries with refresh actions
- Multilingual-aware cache keys (WPML / Polylang / locale)
Requirements
- WordPress 6.0+
- PHP 7.4+
- An API key for at least one provider (Gemini free tier is the quickest way to start)
Installation
- Clone or download this repository into
wp-content/plugins/:
cd wp-content/plugins
git clone https://github.com/Vanilla-Core/vc-briefly.git
- In WP Admin, go to Plugins and activate VC Briefly.
- Open Settings → VC Briefly.
- Paste a Gemini API key (free demo) or an OpenAI / Anthropic key, then save.
Quick start (themes)
// Default length (from settings, usually 250), current post content
echo esc_html( vc_briefly() );
// Custom length
echo esc_html( vc_briefly( 150 ) );
// Echo helper (already escaped)
vc_the_briefly( 150 );
// Custom source string
$blurb = vc_briefly( 200, $custom_html_or_text );
// With args
$blurb = vc_briefly( 180, null, array(
'post_id' => 42,
'lang' => 'en',
'fallback' => 'trim', // or 'empty'
'force' => false, // true = bypass cache
) );
Shortcode
[vc_briefly length="200"]
[vc_briefly length="150" post_id="42"]
Gutenberg block
Insert the VC Briefly block. Sidebar settings:
- Length (characters;
0= settings default) - Content source: current post or custom text
- HTML wrapper tag:
p,div, orspan
REST API
Public post types expose a read-only vc_briefly field:
GET /wp-json/wp/v2/posts/123
GET /wp-json/wp/v2/posts/123?vc_briefly_length=150
Response shape:
{
"text": "…",
"length": 150,
"cached": true
}
How caching works
Summaries are stored in {prefix}vc_briefly_summaries and keyed by a hash of:
- normalized source text
- target length
- language
- model id
- prompt version
If the post content (or length / lang / model / prompt version) changes, a new summary is generated. Identical requests reuse the cached result and save AI tokens.
On each post edit screen, the VC Briefly meta box lists cached rows for that post. Use Refresh to delete a row so the next front-end call regenerates it.
Settings
Settings → VC Briefly
| Setting | Purpose |
|---|---|
| Active provider | gemini, openai, or anthropic |
| API keys | Per-provider keys (masked when saved) |
| Models | Dropdowns; Gemini free tier unlocks Flash-Lite Latest only |
| Default length | Used when no length is passed to vc_briefly() |
| Timeout / fallback | Request timeout and trim-or-empty fallback |
| Prompt version | Bump to invalidate summary style via new cache hashes |
Filters (for developers)
add_filter( 'vc_briefly_source', function ( $content ) {
return $content;
} );
add_filter( 'vc_briefly_prompt', function ( $prompt, $length, $lang ) {
return $prompt;
}, 10, 3 );
add_filter( 'vc_briefly_result', function ( $result, $plain, $target, $from_cache ) {
return $result;
}, 10, 4 );
add_filter( 'vc_briefly_fallback', function ( $result, $plain, $target, $mode ) {
return $result;
}, 10, 4 );
Behavior notes
- Content shorter than the target length is returned as-is (no AI call).
- Output is plain text (HTML/shortcodes stripped before summarization).
- If the API key is missing, rate-limited, or the request fails, VC Briefly falls back to a plain trim so templates keep working.
License
GPL-2.0-or-later