=== Article from YouTube ===
Contributors: startuphubai
Tags: article, editor, content, video, draft
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.5.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Paste a YouTube URL in a post or page, click Generate, and fill the title and body with a draft article. Paid plans can watch a channel.

== Description ==

Article from YouTube is a small editor tool. Open a post or page, paste a YouTube URL in the sidebar box, and click **Generate article**. The plugin asks StartupHub.AI to transcribe the video and write a draft, then puts that HTML into the editor.

You review the draft. You publish it.

On Pro Mini and up, you can also add YouTube channels in settings. StartupHub.AI watches each channel RSS feed on the fetch frequency you pick (every 30 minutes, hourly, every 3 hours, every 6 hours, or daily), writes an article when a new video appears, and either saves a draft or publishes. Drafts can be approved from email or Telegram.

= What you need =

A StartupHub.AI API key. Create one at [startuphub.ai/youtube-to-article](https://www.startuphub.ai/youtube-to-article). The free plan includes a small number of articles from the editor. Channel watch is on Pro Mini and up. The cap is on their service, not a timer inside this plugin.

= Defaults =

On Article from YouTube in the admin menu you paste your API key, edit the writing prompt (tone and length live in that prompt), choose whether to pin the original video, and set internal-link ranking plus how many links to attempt (dynamic, or 1 to 4). Generate ranks published articles and tag archives using title, tags, categories, and cornerstone flags. Connect Search Console in settings for query-level ranking (clicks, impressions, position, and query overlap). Site Kit or Rank Math can supply that data if they are already connected and you have not connected Search Console here. After the draft is written, a second service call inserts those links. Generate fills focus keyphrase, SEO title, and meta description, and writes those into Yoast or Rank Math when those plugins are active.

Channel settings include fetch frequency, publish vs draft, default author and category, notify email, and an optional Telegram link.

== External services ==

**StartupHub.AI (required to generate and to watch channels).** This plugin sends requests from your WordPress server to:

https://www.startuphub.ai/api/v1/youtube-to-article/generate

https://www.startuphub.ai/api/v1/youtube-to-article/internal-links

https://www.startuphub.ai/api/v1/wp-writer/sites

https://www.startuphub.ai/api/v1/wp-writer/sources

https://www.startuphub.ai/api/v1/wp-writer/jobs

https://www.startuphub.ai/api/v1/wp-writer/jobs/ready

https://www.startuphub.ai/api/v1/wp-writer/telegram/start

https://www.startuphub.ai/api/v1/youtube-to-article/gsc

https://www.startuphub.ai/api/v1/youtube-to-article/gsc/start

https://www.startuphub.ai/api/v1/youtube-to-article/gsc/rows

The generate request includes your API key (as a Bearer token), the YouTube URL you pasted, your writing prompt, and whether to pin the video. A first call asks for a transcript. A second call sends that transcript plus the video title and channel name so the service can write the article. A third call sends the draft HTML plus ranked candidate URLs from this site (published articles, tag archives, and any extra URLs you listed) so the service can insert internal links. That third call does not write a new article. If it fails, the draft stays unlinked. Nothing is sent until you click Generate.

When you save settings or add a channel, the plugin sends your site URL, inbound secret, notify email, default author and category, and the YouTube URL you entered so the service can register the site and watch that channel. It also asks for recent job status and any drafts that did not arrive, then creates those posts locally. Telegram start only runs if you click Link Telegram.

Connect Search Console only runs if you click that button. The plugin sends your site URL and a return URL under wp-admin, then Google asks you to approve read-only Search Console access. StartupHub.AI stores the token for that API key and later fetches query and page rows to rank internal links. Disconnect removes that token.

StartupHub.AI may push a finished article to this site at:

/wp-json/afyt/v1/inbound

That request is signed with the inbound secret stored in settings.

If Search Console is not connected here, and Site Kit by Google or Rank Math already stored Search Console data on this site, those local analytics can still be used to rank internal links.

* Service: https://www.startuphub.ai
* Terms: https://www.startuphub.ai/terms
* Privacy: https://www.startuphub.ai/privacy

== Installation ==

1. Upload the plugin, or install it from Plugins → Add New once it is in the directory.
2. Activate it.
3. Open Article from YouTube in the admin menu and paste your API key.
4. Edit a post or page, paste a YouTube URL in the sidebar, and click Generate article.
5. Optional, on a paid key: add a channel and choose how often to check it.
6. Optional: Connect Search Console in settings so internal-link ranking can use queries and clicks.

== Frequently Asked Questions ==

= Do I need a StartupHub.AI account? =

Yes, if you want to generate. Without an API key the Generate button cannot finish.

= Does it send data off the site? =

Yes, when you click Generate, Connect Search Console, save channel settings, or when StartupHub.AI pushes a finished article. See External services.

= Will it publish the post for me? =

Generate fills the editor. You review and publish. Channel watch can save a draft or publish, depending on the setting for that channel.

= Does it watch my YouTube channel or a playlist? =

Channel watch is on Pro Mini and up. Add a channel URL in settings and pick a fetch frequency. Playlists are not watched. Free keys still generate from a single URL in the post editor.

= How often are channel feeds checked? =

You pick per channel: every 30 minutes, every hour, every 3 hours, every 6 hours, or every day. StartupHub.AI looks at due channels about every 10 minutes and skips a channel until its interval has passed.

= Does a visitor need an account? =

No. Only people who can edit posts see the generator.

== Changelog ==

= 1.5.4 =
* Plugin Check: Rank Math SQL uses {$wpdb->prefix}, video lookup is a prepared postmeta query.

= 1.5.3 =
* Plugin Check: nonce in each channel form handler, safe OAuth redirects, skip the current post without post__not_in, cache Rank Math reads.

= 1.5.2 =
* Directory review: four-character prefixes, no load_plugin_textdomain, no site-wide activation notice.

= 1.5.1 =
* Channels and Search Console stay visible without an API key. They stay dim until you enter a key and save.
* Readme: Tested up to WordPress 7.1 for the plugin directory.

= 1.5.0 =
* Connect Search Console in settings for query-level internal-link ranking. Site Kit and Rank Math remain a fallback if they are already on the site.

= 1.4.0 =
* Watch YouTube channels with a per-channel fetch frequency. Draft or auto-publish, default author and category, email and Telegram approve, HMAC inbound plus a pull fallback if a push misses.

= 1.3.0 =
* Writing prompt in settings. Dedicated internal-link pass with a count setting (dynamic, or 1 to 4 attempted links). Candidates are published articles and tag archives, ranked with Search Console via Site Kit or Rank Math plus title, tags, categories, and cornerstone. SEO title, meta description, and focus keyphrase, including Yoast and Rank Math when those are active. No footer credit option.

= 1.2.0 =
* First directory release: editor box for posts and pages, server-side generate via StartupHub.AI, Gutenberg and classic editors.
