No description
  • PHP 67.6%
  • JavaScript 16.1%
  • CSS 11.1%
  • HTML 3.3%
  • Shell 1.6%
  • Other 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-09-03 01:42:14 +00:00
.github major changes to metadata reading 2025-08-25 13:59:28 +00:00
assets Add album upload feature with sequential uploads 2025-09-03 01:42:10 +00:00
build docs 2025-08-31 00:17:08 +00:00
builders major changes to metadata reading 2025-08-25 13:59:28 +00:00
compat/woocommerce-subscriptions member3-phase2-niggle1-twatfix 2025-08-22 00:23:58 +00:00
docs adsdf 2025-08-31 06:25:22 +00:00
languages major changes to metadata reading 2025-08-25 13:59:28 +00:00
md-files major changes to metadata reading 2025-08-25 13:59:28 +00:00
member-docs chore: remove local .bak backup artifacts from repo workspace 2025-08-27 09:20:46 +00:00
src Add album upload feature with sequential uploads 2025-09-03 01:42:10 +00:00
subscriptions-example subs mission 2025-08-17 00:54:14 +00:00
subscriptions-useful member3-phase2-niggle1-twaup 2025-08-22 00:19:20 +00:00
test ----555- 2025-08-29 10:34:48 +00:00
.gitignore major changes to metadata reading 2025-08-25 13:59:28 +00:00
.gitmodules major changes to metadata reading 2025-08-25 13:59:28 +00:00
CHANIMATION.md major changes to metadata reading 2025-08-25 13:59:28 +00:00
CODE_RULES.md Selective carryover from wip/gpt5-player-snapshot-20250826-090045 into stable/last-working-20250826-093819: FormatDownloader, ProductProcessor, test/ scripts, and docs. No player/renderer/REST changes. 2025-08-26 09:39:51 +00:00
composer.json major changes to metadata reading 2025-08-25 13:59:28 +00:00
composer.lock major changes to metadata reading 2025-08-25 13:59:28 +00:00
p_enqueue_media();\\ Refactor admin JavaScript to modern vanilla JS architecture 2025-08-30 03:50:06 +00:00
README.md Update README with chunked uploads and testing info 2025-08-31 07:48:01 +01:00
SndActivation.php activation tweak. vault refactor 2025-08-28 06:05:31 +00:00
SndCore.php rainbow wave 2025-08-28 03:50:10 +00:00
SndDeactivation.php activation tweak. vault refactor 2025-08-28 06:05:31 +00:00
SndMigrate.php Reset hooks, bootstrap, and player renderer files 2025-08-27 23:35:07 +00:00

SndCore — Audio Commerce Engine for WordPress/WooCommerce

Highperformance audio streaming and commerce toolkit powering large catalogs and multiGB files on WooCommerce. Secure REST streaming, demo generation, product automation, and member features, implemented with modern WordPress plugin practices.

Highlights

  • WooCommercenative products and albums with player integration
  • Secure REST streaming with signed URLs, nonce checks, and HTTP Range support
  • FFmpegpowered demo creation (duration %, start offset, fade), with caching
  • Largefile delivery and packaging (multiformat zip builder) with safe tmp handling
  • Frontend and wpadmin album creation flows
  • Membership features: likes, comments, chat, vault
  • Subscription integration example for recurring products
  • Content restriction by membership tier/role
  • Player engines and skins, assets enqueued only when needed
  • Performance: batched config reads, streaming direct from disk, transient caches
  • Engineering discipline: PSR12, PSR4 autoload, SRP, centralized hooks, typed PHP
  • Chunked Uploads for large albums
  • Tested with 50 gig album. Playback and Package Generation for 438 tracks seamlessly.
  • Extensive Admin Interface

What this codebase does well

  • SingleResponsibility and dependency boundaries: Core/Bootstrap wires services; feature code pulls dependencies from Bootstrap, never via adhoc new.
  • Hooks isolation: only Core/Hooks registers actions/filters; constructors remain sideeffect free.
  • Config/state model: snd* keys with inheritance (product override → global → default), bulk getters to reduce DB roundtrips.
  • Security posture: nonces for internal REST, capability checks, input sanitization, prepared statements, escaped output.
  • Streaming correctness: HTTP Range, partial content, local stream or remote redirect through Storage/FileManager.
  • UI separation: PHP that outputs HTML lives under UI/*; domain logic does not echo.
  • Scale: assets enqueued on demand, demo outputs cached, longrunning work delegated to FFmpeg paths, and download packaging uses tmp + lock discipline.

Architecture at a glance

  • Core: Bootstrap, Config, Hooks
  • Audio: Audio, Player, PlayerManager, PlayerRegistry, Streamer, PlaybackController, DemoCreator, DownloadProcessor
  • Storage: FileManager, Cloud (providers), optional Google Drive client
  • REST: StreamController (audio), PlaylistController, CustomPricePaymentController
  • WooCommerce: WooCommerceIntegration, ProductProcessor, AlbumUploadModal, AlbumUploadProcessor, FormatDownloader, BatchProductAssigner, PurchasersDisplay
  • UI: Renderer, ProductRenderer, DownloadRenderer, AdminRenderer, DbRenderer, widgets/templates
  • Members: Vault, MemberDashboard, Comments, Chat, ContentRestriction, UsersPageIntegration
  • Subs: SubscriptionFormHandler/Manager/Products and Woo integration (example module)
  • Db: Installer, Monitor, Clean
  • Utils: Analytics, Cache, Debug, Update, Utils

See /src for the full tree.

How streaming and demos work

  1. Request arrives via REST route (sndcoreplayer/v1/stream/{product_id}/{file_id}) with nonce.
  2. Permission check: purchase, login requirements, and content restrictions enforced.
  3. Config resolution: global + product overrides fetched via Config (bulk where possible).
  4. Demo path (when applicable): DemoCreator builds/caches a truncated file (duration %, start, fade) via FFmpeg.
  5. Delivery: Storage/FileManager streams local files with Range; remote sources redirect. Headers and partial content handled correctly.

Settings and state

  • Keys prefixed snd.
  • Global settings stored in the snd_global_settings option.
  • Productlevel overrides use post meta with the same keys.
  • Use Config::getStates([...]) for batched reads; write via Config::updateState() then persist.

Requirements

  • WordPress 6.5+
  • WooCommerce 8+
  • PHP 8.3+
  • FFmpeg available when demo generation is enabled
  • Permalinks + REST API enabled

Development guardrails

  • PSR12, strict_types, typed properties/returns
  • Centralize hooks in Core/Hooks; avoid work in constructors
  • Do not echo HTML from nonUI classes; route rendering via UI/*
  • Do not instantiate services directly; request them from Bootstrap
  • Do not read/write settings directly; go through Core/Config
  • Enqueue assets conditionally; keep front end lean

Repository structure (toplevel)

  • SndCore.php — plugin entry point
  • composer.json — PSR4 autoload: "SndCore\": "src/"
  • src/Core — Bootstrap, Config, Hooks (initialization + hook registration)
  • src/Audio — player, streaming, demo and download helpers
  • src/Storage — FileManager, cloud clients
  • src/REST — REST endpoints
  • src/WooCommerce — integration and product/album tooling
  • src/UI — renderers and admin views
  • src/Members, src/Subs — members and subscriptions modules
  • docs/ and mdfiles/ — internal design docs and manuals

Internal docs

  • docs/BOOTSTRAPINITIALIZATION.md
  • docs/CONFIGMANAGEMENT.md
  • docs/HOOKSREGISTRATION.md
  • CODE_RULES.md
  • mdfiles/REST_API.md
  • mdfiles/HowDemosWork.md

Notes

  • Subscriptions code is provided as an example module; enable and adapt per project needs.
  • Large file support depends on your PHP/web server limits; SndCore streams efficiently but honors host caps.