# ogCover WordPress Plugin

**Русский:** [README.ru.md](README.ru.md)

WordPress plugin for automatic Open Graph image generation via the ogCover API.

## Version

`1.0.2`

## Requirements

- WordPress `6.0+`
- PHP `7.4+`
- Active ogCover account with API key

## Features

- Generates OG images for **posts** and **static pages** on save/publish
- Saves generated images into the WordPress Media Library
- Injects `og:image` and `twitter:image` tags into page head
- Supports manual single-post regeneration from post editor
- Supports bulk generation for published **posts** and **pages**
- Supports homepage cover generation from separate template

## Installation

1. Download the plugin ZIP from the [ogCover downloads page](https://ogcover.io/downloads/wordpress).
2. In WordPress: `Plugins -> Add New -> Upload Plugin` and select the file.
3. Activate the plugin.
4. Open `Settings -> ogCover`.

## Configuration

Set the following values in plugin settings:

- **API Key**: from `https://ogcover.io/dashboard/keys` (e.g. `og_live_a1b2c3...`)
- **Template ID**: default template for **blog posts**. Also the fallback for **static pages** if you do not set Page Template ID.
- **Page Template ID** (optional): if set, used **only** for WordPress **Pages**; if empty, pages use the same template as posts.
- **Home Template ID** (under *Homepage Cover*): optional template for the **site front page** OG image. If the front page is a **static page**, this image is used first when set; otherwise the plugin falls back to that page’s own generated cover. Leave empty if you do not need a separate home cover.
- **Auto Update**: controls automatic regeneration on post save

## Notes

- Existing generated image is replaced on regeneration.
- Plugin stores generation metadata in post meta keys with `_ogcover_` prefix.
- If API quota is exceeded, plugin shows an admin warning notice.
- When you are out of image credits (or otherwise past the free allowance), ogCover may still return an image with a small **“ogCover” watermark in the bottom-right corner**. You can turn this behaviour off in your **ogCover account settings** on [ogcover.io](https://ogcover.io) (watermark when quota is exceeded) if you prefer images without a watermark.
