=== Ohara - Feed Builder For YouTube ===
Contributors:      iqbal1hossain
Tags:              youtube, youtube feed, video gallery, youtube gallery, youtube channel
Requires at least: 6.0
Tested up to:      7.1
Requires PHP:      7.4
Stable tag:        1.1.0
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Build, cache, and display beautiful YouTube feeds anywhere on your site with a live-preview feed builder, shortcode, and block.

== Description ==
**[Ohara](https://wpshark.xyz/ohara/)** turns a YouTube channel into a clean, fast, responsive feed you can drop anywhere on your WordPress site — with a real feed builder instead of a wall of shortcode attributes.

Create a feed in a guided four-step wizard (Type, Source, Layout, Review), then fine-tune it in a two-pane editor: settings on the left, a live desktop/tablet/mobile preview on the right with undo and redo. When you are happy with it, copy the shortcode, insert the block, or paste a PHP snippet.

Every feed is server-rendered first, so your videos are visible to search engines and to visitors without JavaScript, and then progressively enhanced into an interactive React app in the browser.

= Key features =

* **Feed builder with live preview** — see layout, color, and section changes as you make them, at three device widths, with undo/redo.
* **Channel feeds** — the latest videos from any YouTube channel, named the easy way by its handle (`@elementrio`) or the exact way by its `UC…` channel ID. Fully functional with nothing to unlock.
* **Three layouts** — Grid, List, and Masonry, all fully responsive.
* **Saved, reusable feeds** — build a feed once, embed it on as many pages as you like; edit it in one place and every embed updates.
* **Three ways to embed** — the `[ohara_feed id="123"]` shortcode, the *Ohara YouTube Feed* block, or a `do_shortcode()` PHP snippet for themes.
* **Per-feed customization** — show or hide the channel header, video titles, and dates; override background, text, and accent colors.
* **Video lightbox** — play videos in a modal without leaving the page.
* **Built-in caching** — API responses are cached with the WordPress Transients API on a schedule you control, so you stay well inside your YouTube API quota. Clear one feed's cache or all of them from the settings screen.
* **Dashboard** — feed count, videos displayed, API and system health, feeds still missing a source, recent activity, and a getting-started checklist.
* **All Feeds screen** — search, filter, and sort every saved feed, with bulk duplicate, embed, and delete.
* **Translation ready** — all strings are localized under the `ohara-feed-builder-for-youtube` text domain.
* **Clean uninstall** — removing the plugin removes its options, transients, and saved feeds.

= PRO =

Take your YouTube feeds to the next level with the **Ohara Pro add-on**. It unlocks powerful new content sources, layouts, and engagement tools while staying fully integrated with the feed builder you already know.

**The Pro add-on offers:**

* **New feed types** — Playlist, Search, Live Streams, Single Videos, and a Social Wall (combining multiple sources).
* **New layouts** — Carousel and Gallery options for more visual storytelling.
* **Engagement tools** — Add a "Load More" button for endless scrolling and a "Subscribe" button to help you grow your audience.
* **Advanced customization** — Custom CSS and JavaScript fields per feed for total design control.

Unlock the full power of Ohara and upgrade to Pro today: **[https://wpshark.xyz/ohara/](https://wpshark.xyz/ohara/)**

= Getting started =

1. Install and activate the plugin.
2. Go to **Ohara → Settings → General** and paste a YouTube Data API v3 key.
3. Go to **Ohara → All Feeds → Create Feed** and follow the wizard.
4. Copy the shortcode from the Embed modal and paste it into any post, page, or widget.

= For developers =

Ohara ships a namespaced REST API under `ohara/v1` and a set of filters for extending the feed types and layouts it supports:

* `ohara_allowed_layouts` — extend the layout list beyond `grid`, `list`, and `masonry`.
* `ohara_feed_layout_renderers` — register a PHP renderer for a custom layout.
* `ohara_feed_types` — add a feed-type slug beyond the built-in `channel`.
* `ohara_feed_type_sources` — register a video-fetching callable for a custom feed type.
* `ohara_feed_cache_args` — supply the cache key for a custom feed type.
* `ohara_sanitize_feed_source` — sanitize a custom feed type's source value.
* `ohara_validate_feed_source` — accept or refuse a custom feed type's source value.
* `ohara_feed_schema` — register additional per-feed settings, which then flow through REST, storage, rendering, and the builder UI on their own.
* `ohara_feed_slot_before_feed` / `ohara_feed_slot_after_feed` — render your own markup above or below the feed, in every layout.
* `ohara_settings_tabs` — add a screen to **Ohara → Settings**, rendered by a React component you register on `window.oharaSettingsPanels`.

Every list is validated server side, so a filter is the supported way to add your own. `ohara_feed_types` only ever adds to the built-in type; it cannot remove it.

The YouTube API client exposes `request()`, `remember()`, `clamp_count()`, and `normalize_item()` so an add-on's feed type reuses this plugin's API key, transport, and cache rather than reimplementing them.

= Source code and contributing =

Ohara is developed in the open. The full, human-readable source — including the uncompiled React and SASS sources behind the bundles in `build/`, and the build scripts used to produce them — lives at:

https://github.com/wp-shark/ohara-feed-builder-for-youtube

Bug reports, feature requests, and pull requests are welcome there. To build the plugin from a checkout, run `composer install && npm install && npm run build` in the plugin directory.

== External services ==

This plugin connects to the **YouTube Data API v3**, a Google service, to fetch the videos and channel details it displays. This is required — without it the plugin has no video data to render.

Requests are sent to `https://www.googleapis.com/youtube/v3/` (the `channels` and `search` endpoints) when a feed is rendered on the front end, when you build or preview a feed in the admin, and when you validate your API key in Settings.

Each request sends only the data needed to identify what to fetch: your YouTube Data API key, the channel the feed points at (its channel ID, or the handle that Ohara looks up once and then remembers), and result parameters such as the maximum number of items and the sort order. No visitor personal data, IP addresses, or site content are sent. Responses are cached in your own database so the same request is not repeated on every page load.

This service is provided by Google. By using the plugin you also agree to Google's terms:

* Google Terms of Service: https://policies.google.com/terms
* Google Privacy Policy: https://policies.google.com/privacy
* YouTube API Services Terms of Service: https://developers.google.com/youtube/terms/api-services-terms-of-service

Embedded video playback is served by YouTube itself and is subject to the same terms.

== Installation ==

= From your WordPress dashboard =

1. Go to **Plugins → Add New**.
2. Search for "Ohara Feed Builder For YouTube".
3. Click **Install Now**, then **Activate**.

= Manual upload =

1. Download the plugin zip.
2. Go to **Plugins → Add New → Upload Plugin** and choose the zip.
3. Click **Install Now**, then **Activate**.

= FTP =

1. Unzip the plugin and upload the `ohara-feed-builder-for-youtube` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** screen in WordPress.

= After activating =

Go to **Ohara → Settings → General** and add a YouTube Data API v3 key, then create your first feed from **Ohara → All Feeds**.

== Frequently Asked Questions ==

= Do I need a YouTube API key? =

Yes. YouTube requires an API key for all data requests. Create a free Google Cloud project, enable the **YouTube Data API v3**, generate an API key, and paste it into **Ohara → Settings → General**. The plugin validates the key as soon as you save it.

= Will this use up my API quota? =

Rarely. Feed responses are cached in your database using the WordPress Transients API, so visitors are served from the cache and YouTube is only contacted when the cache expires. You can change the caching interval — or clear all caches — under **Ohara → Settings → Feeds**.

= How do I display a feed? =

Every saved feed has an Embed modal with three options: the `[ohara_feed id="123"]` shortcode, the *Ohara YouTube Feed* block, and a PHP snippet for use in theme templates.

= Can I use the same feed in more than one place? =

Yes. A feed is a saved, reusable record. Embed it as many times as you like; editing the feed once updates every place it appears.

= Does it work without JavaScript? =

Yes. Each feed is rendered as real HTML on the server first, so search engines and visitors without JavaScript still see your videos. The interactive layer loads on top of that markup.

= Can I change how the feed looks? =

Each feed has its own header, title, and date toggles, plus optional background, text, and accent color overrides. For anything beyond that, use the CSS editor built into WordPress at **Appearance → Customize → Additional CSS**, or your theme's stylesheet.

= What happens to my feeds if I delete the plugin? =

Deleting the plugin removes its settings, cached feed data, and saved feeds. Deactivating it leaves everything in place, so you can safely deactivate and reactivate without losing your work.

= How can I contribute, or report a bug? =

Development happens on GitHub at https://github.com/wp-shark/ohara-feed-builder-for-youtube — open an issue for bugs and feature requests, or send a pull request. The repository's CONTRIBUTING.md covers coding standards, the security checklist, and what is expected in a PR.

= Do I need the channel ID, or can I use the @handle? =

Either one. Paste the handle shown on the channel page — `@elementrio` — and Ohara looks up the matching channel ID for you, once, and caches it. Or paste the `UC…` channel ID from the channel's **Settings → Channel → Advanced settings** if you already have it. Pasting the address of the channel page works too. Whichever you enter is what the feed keeps showing you, so there is nothing to translate back and forth.

If a handle stops working because the channel changed it, clear the cache under **Ohara → Settings → Feeds** and the new one is looked up on the next load.

= Which feed types are available? =

Channel — a feed of a channel's latest videos, named by handle or by channel ID. It is built in and works as soon as you have added an API key; there is nothing in this plugin to unlock. Developers can add further feed types with the `ohara_feed_types` and `ohara_feed_type_sources` filters, and an add-on plugin may ship its own.

= Which layouts are available? =

Grid, List, and Masonry. Developers can register additional layouts with the `ohara_allowed_layouts` and `ohara_feed_layout_renderers` filters.

== Screenshots ==

1. The dashboard: feed stats, API and system health, and a getting-started checklist.
2. The Create Feed wizard: Type, Source, Layout, and Review in four steps.
3. The feed editor with its live, device-responsive preview.
4. Defaults Settings
5. All Feeds: search, filter, sort, and bulk actions across every saved feed.
6. Settings: API key, caching interval, and cache controls.
7. Advanced Settings
8. The Embed modal: shortcode, block, and PHP snippet.

== Changelog ==

= 1.1.0 =
* YouTube channel ID and handle support

= 1.0.0 =
* Initial release.
* Feed builder with four-step create wizard and live device-responsive preview.
* Channel feed type.
* Grid, List, and Masonry layouts.
* Saved, reusable feeds with search, filter, sort, and bulk actions.
* `[ohara_feed]` shortcode, Ohara YouTube Feed block, and PHP snippet embeds.
* Per-feed header, title, date, and color options.
* Transient-based feed caching with a configurable interval and manual flush.
* Server-rendered no-JavaScript fallback markup.

== Upgrade Notice ==

= 1.0.0 =
Initial release.