=== Titlize ===
Contributors: titlize
Tags: og image, open graph, social media, featured image, seo
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically generate professional Open Graph images with text overlays for your posts and pages.

== Description ==

Titlize automatically generates beautiful Open Graph (OG) images for your WordPress posts and pages. Simply publish your content, and the plugin will create a professional social media preview image using your featured image and post title.

= Key Features =

* **Automatic OG Image Generation** - Generate OG images automatically when you publish or update posts
* **Per-Post Customization** - Override default settings for individual posts with custom titles, subtitles, and styling
* **Preview Before Publishing** - See exactly how your OG image will look before you publish
* **Manual Regeneration** - Regenerate images anytime with a single click
* **Bulk Regeneration** - Update multiple posts at once from the posts list
* **Smart Caching** - Avoid unnecessary API calls with intelligent cache invalidation
* **Brand Kit Integration** - Use your brand colors and logo from your Titlize account
* **Custom Post Type Support** - Enable OG image generation for any post type
* **Gutenberg Block** - Insert titled images directly in your post content

= How It Works =

1. Configure your API token in Settings > Titlize
2. Set your default text position, color mode, and other preferences
3. Publish your posts - OG images are generated automatically
4. Customize individual posts using the Titlize meta box

= Requirements =

* WordPress 6.0 or higher
* PHP 8.1 or higher
* A Titlize API account ([sign up here](https://titlize.com)) — a free tier generates real Open Graph images (no sandbox); see [Terms of Use](https://titlize.com/terms)

== Installation ==

1. Upload the `titlize` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Settings > Titlize to configure your API token
4. Start publishing posts with automatic OG images!

= Manual Installation =

1. Download the plugin zip file
2. Go to Plugins > Add New > Upload Plugin
3. Choose the downloaded file and click Install Now
4. Activate the plugin and configure your API token

== Frequently Asked Questions ==

= Do I need a Titlize account? =

Yes, the plugin requires a Titlize API token to generate images. You can sign up for a free account at [titlize.com](https://titlize.com).

= What image formats are supported? =

The plugin supports JPEG, PNG, GIF, and WebP images as source images. Generated OG images are delivered in an optimized format.

= What are the recommended image dimensions? =

For best results, use featured images that are at least 1200x630 pixels. The plugin will warn you if an image is smaller than recommended.

= Can I use this with custom post types? =

Yes! Go to Settings > Titlize and enable the post types you want to use with automatic OG image generation.

= How does caching work? =

The plugin caches generated images to avoid unnecessary API calls. When you change the post title, featured image, or OG image settings, the cache is automatically invalidated and a new image will be generated on the next publish.

= Can I preview the OG image before publishing? =

Yes, use the "Preview OG Image" button in the Titlize meta box to see how your image will look before publishing. There's a cooldown period between previews to prevent excessive API usage.

= Does this work with SEO plugins? =

Yes, Titlize provides a filter hook (`titlize_og_image_url`) that SEO plugins can use to get the generated OG image URL.

= Is multisite supported? =

WordPress Multisite is not currently supported. The plugin will display a notice if activated on a multisite installation.

== Screenshots ==

1. Settings page with API token configuration and default generation settings
2. The Titlize block in the editor — compose a titled image with a live preview
3. Bulk-regenerate Open Graph images from the posts list
4. A generated Open Graph image, ready to share

== Development ==

The full, unminified source for the block and admin scripts ships inside this plugin under `blocks/src/` and `admin/src/`. The `blocks/build/` and `admin/dist/` files are compiled from that source with [@wordpress/scripts](https://www.npmjs.com/package/@wordpress/scripts) (webpack).

To rebuild from source:

`npm install && npm run build:all`

* `npm run build` — compiles the Gutenberg block (`blocks/src` → `blocks/build`)
* `npm run admin:build` — compiles the admin scripts (`admin/src` → `admin/dist`)

== Changelog ==

= 1.0.0 =
* Initial release
* Automatic OG image generation on post publish
* Per-post customization via meta box
* Preview functionality with cooldown
* Single and bulk regeneration
* Smart caching with automatic invalidation
* Brand kit integration
* Custom post type support
* Gutenberg block for inline images

== Upgrade Notice ==

= 1.0.0 =
Initial release of Titlize for WordPress.

== External services ==

This plugin relies on the Titlize service to generate Open Graph images. It requires a Titlize account and API token, and it will not generate images without one.

**Titlize API — api.titlize.com**
What it is: the Titlize image-generation API. What it is used for: turning your featured image and post title into an Open Graph image. When you publish or update a post, preview an image from the meta box, or run a manual/bulk regeneration, the plugin sends to this service: your featured image, the post title and optional subtitle text, and your styling preferences (text position, color mode/hex, font), authenticated with your Titlize API token. The service returns the URL of the generated image.

**Titlize image storage — storage.titlize.com and storage.googleapis.com**
What it is: where the generated images are hosted (Titlize storage, backed by Google Cloud Storage). What it is used for: after the API returns an image URL, the plugin makes a plain GET request to that URL to download the finished image and save it to your WordPress media library. No personal data is sent other than the request for that specific image.

This service is provided by Titlize. See the [Terms of Use](https://titlize.com/terms) and [Privacy Policy](https://titlize.com/privacy).

== Privacy Policy ==

Titlize sends data to the Titlize API service to generate images. This includes:

* Your featured image
* Post title and subtitle text
* Styling preferences (position, colors)

No personal user data is transmitted. Generated images are stored in your WordPress media library.

= API Token Storage =

Your API token is stored obfuscated at rest: it is encrypted with AES-256-CBC keyed on your site's own WordPress secret key (SECURE_AUTH_KEY, falling back to AUTH_KEY) before being saved to the options table, and the settings screen only ever shows a masked placeholder. This obfuscation-at-rest protects the token against a database-only disclosure (for example a DB dump without wp-config.php); it is not a secrecy guarantee against an attacker who already has both the database and your wp-config.php secret keys. If your site has no WordPress secret keys configured, the plugin refuses to store a token rather than fall back to a built-in default key.

For more information, see the [Titlize Privacy Policy](https://titlize.com/privacy).
