Buzzsaw
Copies each product’s Featured Image and original-art (custom field URL) into a fixed mount: /mnt/ccpi/mnt/nas/Website-Orders/<Site Title>/<Product Title>. Skips identical files (same size). Background-safe with live progress and nightly cron (1–5 AM). Auto-updates from GitHub.
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/emkowale/buzzsaw/releases/download/v1.1.19/buzzsaw-v1.1.19.zipDeclares an update source (https://github.com/emkowale/buzzsaw), so updates arrive through the plugin's own updater.
Readme
Buzzsaw — Affiliate-Side WooCommerce Plugin
Buzzsaw copies each product’s Featured Image and original-art (a custom field URL) into a fixed NAS mount, de-duplicates by file size, supports a manual push screen with live progress, and runs a nightly randomized cron (1–5 AM). It also supports WordPress updates via GitHub releases.
Fixed Destination (DO NOT CHANGE)
/mnt/ccpi/mnt/nas/Website-Orders/<WordPress Site Title>/<WooCommerce Product Title>/
- Root is hardcoded to:
/mnt/ccpi/mnt/nas/Website-Orders - Mount should exist at
/mnt/ccpi(e.g., via sshfs + systemd automount)
What Buzzsaw Copies
For each published WooCommerce product:
- Featured image (full-size attachment file)
- original-art — URL stored in custom field
original-art(downloaded and saved)
De-duplication: If a target file already exists with the same file size, it is not recopied.
Admin UI
Top-level menu:
Buzzsaw
├─ Settings
└─ Push to thebeartraxs.com
- Settings: stores
buzzsaw_rest_key(REST API key for thebeartraxs.com). - Push…: a Start button to kick off copying. Shows live progress (percentage/pie). Continues in background if you navigate away.
Cron (Automatic Nightly Push)
- Randomized once nightly between 1:00–4:59 AM (server time)
- Hook:
buzzsaw_nightly_push - Scheduled on activation; cleared on deactivation
Update Flow (WordPress ↔ GitHub)
buzzsaw.phpcontains:Version: X.Y.Zdefine('BUZZSAW_VERSION', 'X.Y.Z');Update URI: https://github.com/emkowale/buzzsaw
- The plugin checks GitHub Releases (
/releases/latest), compares the tag (e.g.v1.2.3, trimmed to1.2.3) toBUZZSAW_VERSION. - If newer, WP shows an update. The release asset ZIP must contain a single root folder named
buzzsaw/.
Directory Structure
buzzsaw/
├─ buzzsaw.php # bootstrap, updater, constants
├─ includes/
│ ├─ class-buzzsaw-admin.php # menu, pages, settings
│ ├─ class-buzzsaw-pusher.php # scanning/copying products
│ └─ class-buzzsaw-cron.php # nightly randomized cron
├─ assets/
│ ├─ css/admin.css # admin styles
│ └─ js/push.js # progress UI (polling)
├─ README.md
├─ CHANGELOG.md
└─ release.sh # release automation
buzzsaw.php (high level)
- Defines constants:
BUZZSAW_VERSION(matches release tag withoutv)BUZZSAW_BASE_PATH=/mnt/ccpi/mnt/nas/Website-Orders
- Includes the 3 class files above
- Hooks WordPress updater (GitHub latest release)
- Registers activation/deactivation for cron
class-buzzsaw-admin.php
- Adds one top-level Buzzsaw menu with two submenus
- Settings page saves
buzzsaw_rest_key - Push page starts the async batch and renders live progress
class-buzzsaw-pusher.php
- For each Woo product:
- Creates target folder:
/mnt/ccpi/mnt/nas/Website-Orders/<Site Title>/<Product Title>/ - Copies featured image if missing/different (size check)
- Downloads
original-artby URL if present (size check)
- Creates target folder:
- Async batch via AJAX; persists progress (option/transient)
class-buzzsaw-cron.php
- On activation: schedule at a random minute in 1–5 AM window
- On hook execution: run the same pusher routine
Security / Safety
- Destination path is hardcoded (site owners cannot change it)
- Operates server-side; no secret exposure
- Graceful if mount is unavailable (skip + log minimal errors)
Release & Update Process
- Bump version in
buzzsaw.phpheader andBUZZSAW_VERSION - Tag Git with
vX.Y.Z - Build archive so zip root is
buzzsaw/ - Create GitHub Release and attach the zip
With release.sh:
./release.sh patch # or: minor | major
Rebuild From Scratch (Quick Steps)
- Create directory
buzzsaw/and subfolders exactly as above - Add the four PHP files + assets (as described)
- In
buzzsaw.php: add WP header, the constants, includes, updater hooks - Ensure
BUZZSAW_BASE_PATH=/mnt/ccpi/mnt/nas/Website-Orders - Activate plugin in WP
- In Buzzsaw → Settings, set the REST key
- Test manual push in Push to thebeartraxs.com
- Confirm nightly cron schedules and runs
- Ship updates with
./release.sh patch→ GitHub Release → WP auto-update
Troubleshooting
- No WP update appears: ensure a GitHub Release exists for
vX.Y.Zwith a zip whose root isbuzzsaw/, andBUZZSAW_VERSION<X.Y.Z. - Copy fails: ensure
/mnt/ccpiis mounted and writable. - Duplicate menu: only one
add_menu_page()should create the root menu.
License
MIT © Eric Kowalewski
Read the full README on GitHub →