=== YT Sub Counter === Contributors: myndsyn, ronknight Tags: youtube, subscriber count, widget, counter, channel Requires at least: 5.0 Tested up to: 7.0 Requires PHP: 7.4 Stable tag: 3.1.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Display your YouTube channel's subscriber count in a widget. == Description == YT Sub Counter adds a widget that displays a YouTube "Subscribe" button with your channel's live subscriber count, powered by the official YouTube subscribe button embed. Admins can configure: * Channel ID * Layout (default or full) * Theme (default or dark) * Subscriber count visibility (shown or hidden) == Installation == 1. Upload the plugin files to the `/wp-content/plugins/yt-sub-counter` directory, or install the plugin through the WordPress plugins screen directly. 2. Activate the plugin through the 'Plugins' screen in WordPress. 3. Go to Appearance > Widgets and add the "Youtube Subscribers" widget to a widget area. 4. Enter your YouTube Channel ID in the widget settings. You can find your Channel ID at https://www.youtube.com/account_advanced == Frequently Asked Questions == = The widget shows an error = Make sure you've entered a valid YouTube Channel ID (not a custom URL or handle) in the widget settings. == External services == This plugin relies on Google's YouTube subscribe button embed to render the live subscriber count and "Subscribe" button. This is a third-party/external service provided by Google. On any front-end page where the widget is displayed, the plugin loads Google's `platform.js` script from `https://apis.google.com/js/platform.js`. Once loaded, that script (running in the visitor's browser, not on our server) connects to YouTube/Google servers to render the subscribe button and fetch the channel's live subscriber count. As with any embedded third-party script, this transmits the visitor's IP address and standard browser/request data (such as the user agent and referring page) to Google, and may set Google cookies, in accordance with Google's own policies. This service is provided by Google LLC: * Terms of Service: https://policies.google.com/terms * Privacy Policy: https://policies.google.com/privacy * YouTube Terms of Service: https://www.youtube.com/t/terms This script loads on every front-end page where the widget is active; there is currently no setting to disable it, as it is required for the widget's core functionality. == Changelog == = 3.1.1 = * Fix: "Tested up to" now correctly lists only the major WordPress version. * Docs: disclose the external YouTube/Google platform.js service in this readme. * I18n: text domain corrected to match the plugin slug (show-youtube-subscribers-count). * Security: escape the filtered widget title with esc_html() before output. * Fix: renamed the generic "google" script handle to the prefixed "ytsub-youtube-platform". = 3.1.0 = * Security: escape widget output (channel, layout, theme, count) with esc_attr() to prevent stored XSS via widget settings. * Fix: enqueue js/main.js as a script instead of a stylesheet. * Fix: correct asset URL resolution so css/js load from the plugin root. * Update: tested up to WordPress 7.0.2. = 2.0.0 = * Add theme options dark and default. * Correct error when using a non custom YouTube URL. = 1.0.0 = * Initial release. == Upgrade Notice == = 3.1.0 = Fixes a stored XSS vulnerability in the widget's front-end output. Upgrade is strongly recommended.