=== YouPickBest – Ranking Polls for Posts ===
Contributors: pickbest
Tags: embed, ranking, poll, voting, quiz
Requires at least: 5.9
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

Add a ranking poll to any post: readers pick between two options at a time and see the community's top list. Paste a link, no setup.

== Description ==

Give readers something to do when they reach the end of your post. A YouPickBest ranking shows two options at a time — two films, two games, two countries — and the reader picks one. After a few rounds they see which option your readers put first overall.

Paste a ranking link on its own line in the editor, and WordPress turns it into the poll. No account, no settings.

= Rankings to try =

Pick one that fits your blog, or browse thousands more at [youpick.best](https://youpick.best):

* Film: https://youpick.best/ranking/the-20-best-animated-movies-of-all-time
* Travel: https://youpick.best/ranking/what-is-the-best-country-to-visit-in-europe
* Games: https://youpick.best/ranking/the-24-greatest-nintendo-switch-games-of-all-time

Can't find your topic? Create your own ranking on youpick.best — its link embeds the same way.

= What the plugin does =

* Shows the full widget: links inside it open normally, and each reader's picks are remembered on their device.
* Sizes the widget to its content, so there is no empty space or inner scrollbar.
* After activation, shows a one-time notice with a "Create a test post" button: it opens a draft with a ranking already in place.

= What it does not do =

* No tracking, no cookies, no data collection by the plugin — and the embedded widget itself sets no cookies either.
* No settings screens.
* The "Browse rankings" links in the notice and on the Plugins screen carry a campaign tag (utm), so we can count visits that start in the plugin. Nothing is sent unless you click.

== External services ==

This plugin embeds interactive ranking widgets from YouPickBest (https://youpick.best), a ranking and voting platform. The connection is needed to render the ranking poll inside your posts.

What is sent and when:

* When WordPress renders a post containing a YouPickBest ranking link, your web server requests the embed details from https://youpick.best/api/oembed and sends the ranking URL. No visitor data is included in this server-side request.
* When a visitor views such a post, their browser loads the widget from youpick.best. Like any embedded content, this request carries standard technical data (IP address, browser user agent) and the address of the embedding page, which YouPickBest uses for per-site vote statistics.
* When a visitor votes inside the widget, their picks and a random token generated by the widget (used to remember the vote on that device) are sent to youpick.best. The widget sets no cookies and sends no personal or account data.

This service is provided by YouPickBest: terms of use — https://youpick.best/terms, privacy policy — https://youpick.best/privacy.

== Installation ==

1. Install the plugin from Plugins → Add New Plugin (search for "YouPickBest") and activate it.
2. Click "Create a test post" in the notice that appears — or on the plugin's row on the Plugins screen. A draft opens with a ranking already embedded.
3. To add a poll to your own post, paste a ranking URL on its own empty line, as plain text — for example: https://youpick.best/ranking/the-20-best-animated-movies-of-all-time
4. The poll appears in the editor preview and on the published post.

Works in both the block editor and the classic editor.

== Frequently Asked Questions ==

= Where do I find rankings to embed? =

Browse [youpick.best](https://youpick.best) or create your own ranking there — every ranking page's URL is embeddable.

= I pasted a link and it stays plain text =

Put the URL on its own line with nothing else on it, pasted as plain text (not inserted as a hyperlink on words). It must be a ranking page URL (youpick.best/ranking/...). In the block editor you can also add an Embed block and paste the URL inside it. If the widget still does not appear, your hosting may be blocking outgoing HTTP requests from PHP — ask your host.

= Does embedding work without the plugin? =

On modern WordPress, yes, but WordPress treats unknown sites as untrusted and puts the widget in a restricted sandbox: links out of the widget don't open and the reader's vote memory resets on every visit. The plugin registers YouPickBest as a trusted embed provider (oEmbed), so the widget renders without those restrictions.

= Does the widget set cookies on my readers? =

No. The widget is cookie-free by design; guest identity lives in the widget's local storage on the reader's device.

= How do I bring back the welcome notice? =

You don't need it: the "Create a test post" link stays on the plugin's row on the Plugins screen.

== Screenshots ==

1. A ranking embedded in a blog post. Readers vote without leaving the page.
2. Readers pick between two options at a time, for as many rounds as they like.
3. In the editor: paste a ranking URL on its own line and the widget appears.
4. After activation: one click creates a test post with a ranking already in place.

== Changelog ==

= 1.1.0 =
* New: welcome notice after activation with a "Create a test post" button that opens a draft with a ranking already embedded.
* New: "Create a test post", "Browse rankings" and "Support" links on the Plugins screen.

= 1.0.0 =
* Initial release: trusted oEmbed provider registration and widget auto-height.

== Upgrade Notice ==

= 1.1.0 =
Adds a one-click test post so you can see a ranking poll in your theme right away.
