Skip to content

LuaGR/nanoreel-wordpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NanoReel WordPress Plugin

Official WordPress plugin for NanoReel - embeddable video widgets for e-commerce conversions.

πŸš€ Quick Start

Installation (Manual)

  1. Download or clone this repository:

    git clone https://github.com/LuaGR/nanoreel-wordpress.git
  2. Copy to WordPress plugins directory:

    cp -r nanoreel-wordpress /path/to/wordpress/wp-content/plugins/nanoreel
  3. Activate plugin:

    • Go to WordPress Admin β†’ Plugins
    • Find "NanoReel" and click "Activate"
  4. Configure settings:

    • Go to WordPress Admin β†’ NanoReel
    • Choose Managed Mode (recommended) or Self-Hosted Mode
    • Save settings

πŸ“‚ Plugin Structure

nanoreel-wordpress/
β”œβ”€β”€ nanoreel.php                         # Main plugin file (entry point)
β”œβ”€β”€ includes/
β”‚   β”œβ”€β”€ class-nanoreel-settings.php      # Admin settings page
β”‚   β”œβ”€β”€ class-nanoreel-shortcode.php     # [nanoreel] shortcode
β”‚   └── class-nanoreel-widget.php        # WordPress widget (sidebar)
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   └── admin.css                    # Admin page styles
β”‚   └── js/
β”‚       └── admin.js                     # Admin page interactivity
β”œβ”€β”€ languages/                            # Translation files (future)
β”œβ”€β”€ README.md                             # This file (developer docs)
β”œβ”€β”€ readme.txt                            # WordPress.org listing
└── LICENSE                               # GPL v2+ license

πŸ› οΈ How It Works

Architecture

  1. Plugin loads widget.min.js from production API:

    • Script URL: https://nanoreel.up.railway.app/public/widget.min.js
    • No local bundling - always fetches latest version
  2. Two operation modes:

    • Managed Mode: Uses widget-id to fetch config from backend API
    • Self-Hosted Mode: Manual configuration (video URL, CTA, colors)
  3. Integration points:

    • Global widget: Auto-injected in wp_footer (all pages)
    • Shortcode: [nanoreel] for manual placement in posts/pages
    • Widget: Sidebar/footer placement via Widgets admin

πŸ“– Usage Examples

Managed Mode (Recommended)

<!-- Admin Settings: Enter widget-id = "nanoreel-main" -->
<!-- Widget automatically appears on all pages -->

Self-Hosted Mode

<!-- Admin Settings: Enter video URL, CTA text/link, accent color -->
<!-- Widget appears with custom configuration -->

Shortcode Usage

<!-- Use global settings -->
[nanoreel]

<!-- Override widget-id -->
[nanoreel widget_id="custom-id"]

<!-- Full manual config -->
[nanoreel 
  video_url="https://example.com/video.mp4"
  cta_text="Shop Now"
  cta_link="https://example.com/shop"
  accent_color="#FFE500"
  shape="rounded"
]

Widget (Sidebar)

  1. Go to Appearance β†’ Widgets
  2. Drag "NanoReel Video Widget" to desired sidebar
  3. Configure Widget ID (or leave empty to use global settings)

πŸ§ͺ Testing Locally

Option A: Existing WordPress Installation

# Copy plugin to your WordPress
cp -r nanoreel-wordpress /Applications/MAMP/htdocs/wordpress/wp-content/plugins/nanoreel

# Activate plugin in WordPress admin
# Test at: http://localhost:8888/wordpress

Option B: Fresh WordPress Setup

# Download WordPress
curl -O https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz

# Copy plugin
cp -r nanoreel-wordpress wordpress/wp-content/plugins/nanoreel

# Setup WordPress (create database, run installer)
# Activate plugin, configure settings

πŸ”§ Development

File Editing Guidelines

  • PHP files: Follow WordPress Coding Standards
  • CSS: BEM naming convention preferred
  • JavaScript: ES5+ (WordPress supports back to IE11)
  • Comments: Explain WHY, not WHAT (see AGENTS.md in core repo)

Commit Message Format

Follow Conventional Commits:

feat: add color picker to self-hosted mode
fix: prevent widget-id from accepting spaces
refactor: simplify shortcode attribute parsing

Testing Checklist

  • Plugin activates without errors
  • Settings page loads (Admin β†’ NanoReel)
  • Managed mode: Widget appears with correct config
  • Self-hosted mode: Custom video/CTA works
  • Shortcode renders widget in posts
  • Widget works in sidebars
  • Color picker functional
  • No JavaScript console errors
  • Mobile responsive (test on iPhone/Android)

πŸ”— Related Resources


πŸ“œ License

GPL v2 or later (required for WordPress.org distribution).

See LICENSE file for full text.


🀝 Contributing

This plugin is currently maintained by the NanoReel core team.

For bug reports or feature requests, open an issue on GitHub.


πŸ“ž Support


Last Updated: 2025-12-21
Version: 1.0.0
Tested up to: WordPress 6.4

About

Official WordPress plugin for NanoReel - embeddable video widgets for e-commerce conversions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published