Architecture
Woo Audio Preview Pro is an add-on that extends the free Audio Preview for WooCommerce plugin. Understanding that seam is the key to extending it correctly.
The free and Pro seam
Section titled “The free and Pro seam”- Pro requires WooCommerce and the free plugin, and both stay active. Pro checks for the free plugin by the class it subclasses (
Wc_Audio_Preview_Public), not by file path, so renaming a directory does not cause a false negative. - Pro boots on
plugins_loadedat priority 4, before the free plugin’s default boot, because Pro must register its filters before the free plugin builds its renderer. It does not boot at include time, since its player class extends the free plugin’s class and the parent must already be defined. - If the free plugin is absent, Pro stands down instead of fataling.
One player, one meta box, one settings page
Section titled “One player, one meta box, one settings page”Pro contributes into the free plugin’s surfaces rather than drawing its own copies:
- Player: Pro’s
Woo_Audio_Preview_Pro_Publicextends the free renderer and is supplied to the free plugin through thewcap_public_instancefilter, so the free plugin registers the product-page hooks on the Pro object. There is one player. - Render location: Pro answers the free plugin’s
wcap_preview_hookfilter with the configured Product Page Position. - Meta box: the free plugin owns the single product meta box. Pro adds the theme select, per-track Preview length column, and the Add and Bulk import buttons through the free plugin’s
wcap_metabox_*action and filter seams, and saves its extra fields onwcap_metabox_save.
Settings resolution
Section titled “Settings resolution”WCAP_Pro_Settings is the single source of truth for settings. Every setting has its default declared in one place and is read through WCAP_Pro_Settings::get() (with is_on() and get_int() helpers). The player is handed one config array from WCAP_Pro_Settings::player_config(), delivered as JSON via wp_add_inline_script so booleans and numbers keep their types.
Data storage
Section titled “Data storage”- Post meta
wcap_audioon the product, an array of:wcap_audio_names[],wcap_audio_urls[],wcap_audio_durations[], andwcap_audio_theme. This is a superset of the free plugin’s contract; the free plugin reads names and URLs and ignores the extra keys, so a downgrade degrades gracefully. Read stored audio through the free plugin’sWCAP_Audio::get()reader, which normalises historical storage shapes. - Options:
wcap_pro_admin_general_option,wcap_pro_player_settings,wcap_pro_watermark_settings,wcap_pro_advanced_settings. - License options:
edd_wbcom_wcap_pro_license_keyandedd_wbcom_wcap_pro_license_status.
One AJAX action, wcap_pro_validate_cdn_url, validates a pasted URL against the known CDN and streaming services in the product editor. It is registered for both logged-in and logged-out contexts and verifies the wcap-pro-admin-nonce nonce.
There is no REST API, no shortcode, and no Gutenberg block in this version. Placement is through the WooCommerce hook chosen on the General tab.
Licensing
Section titled “Licensing”Updates and licensing use Easy Digital Downloads Software Licensing against wbcomdesigns.com. The store URL and item name are set in edd-license/edd-plugin-license.php.

