=== Saiy2k Nostr Components === Contributors: saiy2k Tags: nostr, social, blocks, gutenberg, shortcodes, zap, like Requires at least: 6.0 Tested up to: 6.8 Requires PHP: 7.4 Stable tag: 0.7.0 License: MIT License URI: https://opensource.org/licenses/MIT Gutenberg blocks and shortcodes for Nostr web components. Display Nostr zap buttons, follow buttons, posts, profiles. == Description == https://www.youtube.com/watch?v=jCaPlEWjeaI Nostr Components brings the power of Nostr (Notes and Other Stuff Transmitted by Relays) to your WordPress site through modern web components. This plugin provides Gutenberg blocks and shortcodes that allow you to seamlessly integrate Nostr content into your posts and pages. = Key Features = * **Gutenberg Blocks**: Modern block editor integration for Nostr Zap button, Post, Profile, Profile Badge, Follow Button, Like Button, and Livestream * **Shortcodes**: Classic editor support with simple shortcode syntax * **Selective Loading**: Enable only the components you need for optimal performance * **Customizable**: Configure relays, themes, and component settings * **Security**: Built-in security with custom element allowlist via KSES * **Performance**: Conditional asset loading based on enabled components = Available Components = * **Nostr Zap button**: Allows your readers to zap to your posts and pages * **Nostr Follow Button**: Interactive follow/unfollow buttons for Nostr users * **Nostr Post**: Display Nostr notes/posts with full content and metadata * **Nostr Profile**: Show complete Nostr user profiles with bio, stats, and social links * **Nostr Profile Badge**: Compact profile display perfect for sidebars and footers * **Nostr Like Button**: Like URLs using Nostr reactions (NIP-25) * **Nostr Livestream**: Display Nostr livestreams (NIP-53) with video playback and participant information = How It Works = 1. Install and activate the plugin 2. Go to Settings → Saiy2k Nostr Components to configure 3. Enable only the components you need 4. Add blocks in the Gutenberg editor or use shortcodes 5. Configure relays and theme settings as needed = Example Usage = **Gutenberg Blocks:** Simply add the Nostr blocks from the block inserter and configure them in the block settings. **Shortcodes:** `[nostr_zap_button pubkey="npub1abc..." url=""]` `[nostr_post eventid="note1abc..."]` `[nostr_profile pubkey="npub1abc..."]` `[nostr_profile_badge pubkey="npub1abc..."]` `[nostr_follow_button pubkey="npub1abc..."]` `[nostr_like_button]` `[nostr_livestream naddr="naddr1abc..."]` = Adding Like and Zap Buttons to All Posts/Pages = To automatically add Like and Zap buttons to the end of every post and page: 1. Go to **Appearance → Theme Editor** (or use a child theme for safer customization) 2. Select your active theme (or child theme) 3. Open `functions.php` 4. Add the following code at the end of the file: // Add shortcode to the end of every post and page function add_shortcode_to_content($content) { // Only add in single posts and pages (not homepage or archives) if (is_singular(['post', 'page']) && in_the_loop() && is_main_query()) { $shortcode_1 = do_shortcode('[nostr_like_button]'); $current_url = esc_url(get_permalink()); $shortcode_2 = do_shortcode('[nostr_zap_button npub="[YOUR-NPUB-GOES-HERE]" url="' . $current_url . '"]'); $content .= '