Skip to content

Releases: kbrookes/Nova-Video-Manager

v0.3.0 - Auto Sync Now Works! 🎉

Choose a tag to compare

@kbrookes kbrookes released this 01 Dec 05:44

🎉 Auto Sync Now Works!

This release implements the missing WP-Cron functionality that makes auto sync actually work.

The Problem

The auto sync checkbox and frequency dropdown existed in Videos → Settings, but there was no WP-Cron scheduling code to actually trigger the sync. The settings were there but did nothing - auto sync never ran.

What's New

Auto sync functionality now actually works
Dedicated NVM_Cron class for WP-Cron scheduling
Automatically schedules/unschedules based on settings changes
Respects sync frequency setting (hourly, twice daily, daily)
Debug logging for all cron activity
Proper cleanup on plugin deactivation

How to Use Auto Sync

  1. Go to Videos → Settings
  2. Check "Enable Auto Sync"
  3. Choose your sync frequency:
    • Hourly - Syncs every hour
    • Twice Daily - Syncs twice per day
    • Daily - Syncs once per day
  4. Click "Save Settings"
  5. Done! Videos will now sync automatically on your chosen schedule

How It Works

  • When you enable auto sync, the plugin schedules a WP-Cron event
  • The event runs at your chosen frequency (hourly, twice daily, or daily)
  • Each time it runs, it syncs videos from your YouTube channel
  • If you change the frequency, it automatically reschedules
  • If you disable auto sync, it unschedules the event
  • On plugin deactivation, all scheduled events are cleaned up

Technical Details

New Files:

  • includes/class-nvm-cron.php - Dedicated cron scheduling class

New Cron Hook:

  • nvm_auto_sync_videos - Triggered on schedule to run sync

Features:

  • Checks if auto sync is enabled before running
  • Logs all cron activity for debugging (check /wp-content/debug.log)
  • Handles settings changes automatically
  • Prevents duplicate scheduled events
  • Properly unschedules on plugin deactivation

Removed:

  • Old duplicate cron code from main plugin file
  • Unused cron methods that weren't working

Debug Logging

If you have WP_DEBUG_LOG enabled, you'll see log entries like:

NVM Cron - Scheduled auto sync with frequency: hourly
NVM Cron - Auto sync triggered
NVM Cron - Successfully synced 15 videos

This helps you verify that auto sync is working correctly.

Checking If Auto Sync Is Scheduled

You can use a plugin like WP Crontrol to view scheduled cron events and verify that nvm_auto_sync_videos is scheduled at your chosen frequency.

Upgrade Notes

  • No database changes required
  • No settings need to be reconfigured
  • If you had auto sync enabled before, you may need to toggle it off and back on to schedule the new cron event
  • Simply update and enable auto sync in settings

Previous Releases:

  • v0.2.7 - Fixed Member ACF fields not registering
  • v0.2.6 - Fixed Video ACF fields not registering
  • v0.2.5 - Debug logging
  • v0.2.4 - REST API support

v0.2.7 - Fix Member ACF Fields Not Registering

Choose a tag to compare

@kbrookes kbrookes released this 25 Nov 06:45

🔧 Fix Member ACF Fields Not Registering

This release applies the same hook timing fix to the Member post type that was applied to Videos in v0.2.6.

What's Fixed

Member Information field group now appears when editing members
Profile URL and Circle Category fields now visible in WordPress admin
Member fields accessible via REST API for Bricks Builder
All ACF field registration issues resolved for both Videos and Members

The Fix

Applied the same did_action('acf/init') check to the Member post type:

  • If acf/init already fired → register fields immediately
  • If not yet fired → add hook as normal

Also added show_in_rest parameter to the Member field group for REST API access.

Member ACF Fields

When editing a member, you should now see the Member Information field group with:

  • Profile URL - Link to member's bio/profile on another site or Circle.so
  • Circle Category - Circle.so category or group

Testing

After updating to v0.2.7:

  1. Edit a member post - you should see the "Member Information" field group
  2. Run the diagnostic at https://yoursite.com/wp-content/plugins/Nova-Video-Manager/acf-diagnostic.php - should show 3 Nova Video Manager field groups:
    • group_nvm_video_metadata (Video Metadata)
    • group_nvm_community (Community Members)
    • group_nvm_member (Member Information)
  3. Use in Bricks Builder - Member fields should be accessible via REST API

Complete ACF Field List

Video Fields:

  • Video Metadata (9 fields)
  • Community Members (relationship field)

Member Fields:

  • Profile URL
  • Circle Category

All fields have show_in_rest enabled for Bricks Builder compatibility.


Previous Releases:

  • v0.2.6 - Fixed Video ACF fields not registering
  • v0.2.5 - Debug logging
  • v0.2.4 - REST API support
  • v0.2.3 - OAuth improvements

v0.2.6 - Critical Fix: ACF Fields Not Appearing

Choose a tag to compare

@kbrookes kbrookes released this 25 Nov 06:12

🔧 Critical Fix: ACF Fields Not Appearing

This release fixes the critical issue where ACF field groups were not registering, causing fields to not appear in WordPress admin and showing as raw shortcodes in Bricks Builder.

The Problem

Symptoms:

  • ACF fields didn't appear when editing videos in WordPress admin
  • Bricks Builder showed raw shortcodes like {acf_nvm_published_at: d/m/Y} instead of actual values
  • ACF diagnostic showed "No Nova Video Manager field groups found"

Root Cause:
Hook timing issue - the plugin's init hook runs at priority 15 (to wait for ACF to load), but ACF's acf/init hook fires at priority 5. By the time our plugin tried to add an action to acf/init, that hook had already fired and wouldn't fire again.

The Solution

Now checks if acf/init has already fired using did_action():

  • ✅ If already fired → register fields immediately
  • ✅ If not yet fired → add hook as normal

This ensures fields are always registered regardless of initialization order.

What's Fixed

ACF fields now appear in WordPress admin when editing videos
ACF field values display correctly in Bricks Builder (no more raw shortcodes)
All video metadata fields accessible via REST API with show_in_rest enabled
Community members relationship field working properly

Available ACF Fields

Video Metadata:

  • nvm_youtube_id - YouTube Video ID
  • nvm_youtube_url - YouTube URL
  • nvm_duration - Video duration
  • nvm_published_at - Published date
  • nvm_view_count - View count
  • nvm_like_count - Like count
  • nvm_comment_count - Comment count
  • nvm_last_synced - Last sync time
  • nvm_description_modified - Description modified flag

Community:

  • nvm_featured_members - Featured community members (relationship field)

Testing

After updating to v0.2.6:

  1. Edit a video post - you should see the "Video Metadata" and "Community Members" field groups
  2. Run the diagnostic at https://yoursite.com/wp-content/plugins/Nova-Video-Manager/acf-diagnostic.php - should show 2 Nova Video Manager field groups
  3. Use in Bricks Builder - ACF fields should now display actual values instead of shortcodes

Upgrade Notes

  • No database changes required
  • No settings need to be reconfigured
  • Simply update and the fields will appear
  • If you moved from local to live, remember to re-enter your OAuth Client Secret

Previous Releases:

  • v0.2.5 - Debug logging
  • v0.2.4 - REST API support
  • v0.2.3 - OAuth improvements
  • v0.2.2 - Videos menu fix
  • v0.2.1 - Settings menu fix
  • v0.2.0 - Initial release with Members feature

v0.2.4 - REST API Support and ACF Diagnostics

Choose a tag to compare

@kbrookes kbrookes released this 25 Nov 05:43

REST API Support and ACF Diagnostics

This release adds full REST API support to all ACF fields and includes a diagnostic tool to troubleshoot field registration issues.

Features

REST API Support: All ACF fields now have show_in_rest enabled, making them accessible in:

  • Bricks Builder query loops
  • WordPress REST API
  • Headless WordPress setups
  • Any REST API consumer

🔍 ACF Diagnostic Tool: New diagnostic page to troubleshoot ACF field registration

  • Access at: https://yoursite.com/wp-content/plugins/Nova-Video-Manager/acf-diagnostic.php
  • Shows ACF status, version, and Pro detection
  • Lists all registered field groups
  • Shows detailed field information
  • Provides troubleshooting recommendations

Fields Now Available via REST API

Video Metadata Fields:

  • nvm_youtube_id - YouTube Video ID
  • nvm_youtube_url - YouTube URL
  • nvm_duration - Video duration
  • nvm_published_at - Published date
  • nvm_view_count - View count
  • nvm_like_count - Like count
  • nvm_comment_count - Comment count
  • nvm_last_synced - Last sync time
  • nvm_description_modified - Description modified flag

Community Fields:

  • nvm_featured_members - Featured community members (relationship field)

Troubleshooting Missing ACF Fields

If you're not seeing ACF fields in the WordPress admin or Bricks Builder:

  1. Run the diagnostic tool: Visit https://yoursite.com/wp-content/plugins/Nova-Video-Manager/acf-diagnostic.php
  2. Check ACF Pro is active: The plugin requires ACF Pro
  3. Re-enter OAuth credentials: If you moved from local to live, re-enter your Client Secret
  4. Deactivate and reactivate: Sometimes helps refresh field registration

For Bricks Builder Users

You can now use all video metadata fields in your query loops:

{acf_nvm_published_at}
{acf_nvm_view_count}
{acf_nvm_like_count}
{acf_nvm_youtube_url}

And filter by featured members using the relationship field!

v0.2.3 - OAuth Callback Improvements

Choose a tag to compare

@kbrookes kbrookes released this 25 Nov 03:59

OAuth Callback Improvements

This release improves OAuth callback handling and error reporting to help diagnose "Unauthorized" errors.

Improvements

  • Better error logging: Added extensive logging for OAuth callback issues
  • Session handling: Redirect to login if user session is lost during OAuth flow
  • Redirect URI filter: Added nvm_oauth_redirect_uri filter to allow customization for different environments
  • Settings page: Now shows the exact redirect URI that should be configured in Google Cloud Console
  • Error messages: More descriptive error messages for troubleshooting

Troubleshooting "Unauthorized" Errors

If you see "Unauthorized" after returning from Google OAuth:

  1. Check the redirect URI on the Settings page matches exactly what's in Google Cloud Console
  2. Enable debug logging in wp-config.php:
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
  3. Check debug.log for lines starting with NVM OAuth to see what's failing
  4. Verify you're logged in as an administrator when completing the OAuth flow

For Developers

You can customize the redirect URI for different environments using the filter:

add_filter( 'nvm_oauth_redirect_uri', function( $uri ) {
    // Customize for your environment
    return $uri;
} );

v0.2.2 - Critical Fix: Videos Menu

Choose a tag to compare

@kbrookes kbrookes released this 25 Nov 03:32

Critical Bug Fix

This is a critical update that fixes the Videos menu disappearing when ACF Pro is installed.

Fixed

  • Videos menu not appearing: Fixed nova_video post type not registering when ACF Pro is active
  • Taxonomies not registering: Fixed video categories, tags, and types not being created
  • Init hook timing issue: Changed NVM_Post_Type and NVM_Taxonomies to call registration methods directly instead of hooking into init

Technical Details

The problem occurred because:

  1. The main plugin's init() method runs at priority 15 (to ensure ACF loads first)
  2. When it instantiated NVM_Post_Type and NVM_Taxonomies, those classes tried to add their own init hooks
  3. Since the init hook was already executing, those new hooks never fired
  4. This prevented the post type and taxonomies from registering

The fix changes the constructors to call register_post_type() and register_taxonomies() directly instead of hooking into init.

Upgrade Instructions

If you installed v0.2.0 or v0.2.1 and don't see the Videos menu:

  1. Update to v0.2.2
  2. The Videos menu will appear immediately
  3. Go to Settings → Permalinks and click Save to flush rewrite rules

v0.2.1 - Fix Settings Menu

Choose a tag to compare

@kbrookes kbrookes released this 25 Nov 03:19

Bug Fix

  • Fixed Settings menu not appearing: Changed init hook priority from 5 to 15 to ensure ACF is loaded before checking if it's active. This fixes the Settings menu not appearing on fresh installs.

Installation

If you installed v0.2.0 and don't see the Settings menu under Videos, update to this version and the menu will appear.

v0.2.0 - Members Feature

Choose a tag to compare

@kbrookes kbrookes released this 25 Nov 03:11

Features

  • Members Custom Post Type: Create reusable community member profiles with name, profile URL, and Circle.so category
  • ACF Relationship Field: Changed from repeater field to relationship field for better filtering and querying
  • On-the-fly Member Creation: Add new members directly while editing videos
  • Unlisted Video Support: OAuth 2.0 authentication now properly fetches unlisted videos
  • Channel-Specific Sync: Fixed sync to only pull videos from the specified channel (not all channels owned by user)
  • Bricks Builder Integration: Full REST API support for member fields in Bricks query loops
  • Enhanced Admin UI: Custom columns in Members list showing profile URL and Circle category

Technical Changes

  • Created NVM_Member_Post_Type class with simplified fields
  • Updated NVM_ACF_Fields to use relationship field instead of repeater
  • Added JavaScript to create 'Add New Member' button in relationship field
  • Updated plugin headers for Git Updater compatibility
  • Added show_in_rest support for member ACF fields
  • Comprehensive documentation updates

Installation

This plugin requires:

  • WordPress 6.0+
  • PHP 8.0+
  • ACF Pro 6.0+
  • YouTube Data API v3 with OAuth 2.0

See OAUTH_SETUP.md for setup instructions.