Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1d79c68
Add show filters for producer and project
raytiley Sep 8, 2024
088d688
Fix null error in display functions
raytiley Sep 2, 2025
e730642
[Performance] - Avoid unnecessary database work
raytiley Sep 2, 2025
dd40556
[Feature] Add CDN thumbnail hosting with opt-in settings and test suite
raytiley Dec 25, 2025
4754560
Fix CI: Install subversion for WordPress test suite
raytiley Dec 25, 2025
fcca061
Fix test failures: register post type and add missing mock properties
raytiley Dec 25, 2025
109b5bd
Fix remaining test issues: add location property, fix cleanup test
raytiley Dec 25, 2025
9119031
[Security] Phase 1: Critical security and reliability fixes
raytiley Dec 25, 2025
30096e5
[Reliability] Phase 2: High-priority reliability improvements
raytiley Dec 26, 2025
9c0d702
[Quality] Phase 3: Code quality and medium-priority improvements
raytiley Dec 26, 2025
31b6d03
[Tests] Phase 4: Expand test coverage
raytiley Dec 26, 2025
68b7ab7
Fix DisplayFilterTest to avoid WordPress loop dependencies
raytiley Dec 26, 2025
b78d97a
[Improvements] Phase 5 - Logging, CDN test, docs, and API config
raytiley Dec 26, 2025
4901648
Fix CDN test to use GET instead of HEAD requests
raytiley Dec 26, 2025
a84ae23
Add dashicons for Shows and Channels post types
raytiley Dec 26, 2025
98b4e43
Add Maintenance section with Reset Sync and Clear Schedule
raytiley Dec 26, 2025
66c0a83
Add database upgrade mechanism and reduce verbose logging
raytiley Dec 26, 2025
77852c8
Add comprehensive shortcode system for schedule and show display
raytiley Dec 26, 2025
7105e0a
Add FullCalendar shortcode and admin documentation
raytiley Dec 26, 2025
510d181
Add VOD chapters support and Danger Zone settings
raytiley Dec 26, 2025
343bf3f
Fix CI test failures: handle empty timezone
raytiley Dec 26, 2025
d6f57f8
Fix channel switcher test: add second channel
raytiley Dec 26, 2025
0ab7c02
Add home page features, priority sync, and fix broken thumbnails
raytiley Dec 26, 2025
d0ae205
Fix failing CI tests for upcoming_runs and format_runtime
raytiley Dec 26, 2025
de1311a
Fix test: truncate schedule table to clear data from previous tests
raytiley Dec 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Tests

on:
push:
branches: [ master, main, develop ]
pull_request:
branches: [ master, main, develop ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
wordpress-version: ['6.2', '6.4', 'latest']

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, mysqli
coverage: none

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress

- name: Install subversion
run: sudo apt-get update && sudo apt-get install -y subversion

- name: Install WordPress test suite
run: |
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 ${{ matrix.wordpress-version }} true
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_CORE_DIR: /tmp/wordpress

- name: Run PHPUnit tests
run: composer test
env:
WP_TESTS_DIR: /tmp/wordpress-tests-lib
WP_CORE_DIR: /tmp/wordpress

# Code style check (optional)
phpcs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: phpcs

- name: Check PHP syntax errors
run: find . -name "*.php" -not -path "./vendor/*" -exec php -l {} \;
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Composer
/vendor/
composer.lock

# PHPUnit
.phpunit.result.cache
/coverage/

# IDE
.idea/
.vscode/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# WordPress test files (local)
/tmp/

# Logs
*.log
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ The plugin provides a function `cablecast_get_schedules($channel_id, $date_start
|`channel_post_id`| |
|`schedule_item_id`| |

**Important: Timezone Handling**

The `cablecast_get_schedules()` function automatically handles timezone conversion. Schedule times are stored in UTC in the database and converted to your WordPress site's configured timezone (Settings > General > Timezone) when retrieved.

Always use `cablecast_get_schedules()` to query schedules rather than direct database queries. This ensures:
- Dates you pass in are interpreted in your site's timezone
- Returned `run_date_time` values are in your site's timezone
- Correct schedule items are returned for the requested date range

Make sure your WordPress timezone is configured correctly in Settings > General for accurate schedule display.

### How do I show the live stream for a channel?
The plugin sets a custom meta property of `cablecast_channel_live_embed_code` to the channel for the embed code to watch the live stream. If this property isn't set it's likely your Cablecast isn't configured correctly, or you don't have a live streaming server.

Expand Down
42 changes: 42 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# wp-cablecast Plugin TODO

## Future Data Sources

### Show Agendas

The theme template `show-agenda.php` supports displaying PDF agendas for shows. Currently this is a placeholder template that needs a data source.

**Required implementation:**
- Add meta field `cablecast_show_agenda_url` to store the URL of the agenda PDF
- Option A: Sync from Cablecast API if agenda attachments are available
- Option B: Allow manual entry via WordPress admin
- Option C: Look for agenda in Cablecast show attachments during sync

**Meta field name:** `cablecast_show_agenda_url`
**Expected value:** Full URL to PDF file (string)

### Show Chapters

The theme template `show-chapters.php` supports displaying chapter markers/timestamps for shows. Currently this is a placeholder template.

**Required implementation:**
- Add meta field `cablecast_show_chapters` to store chapter data
- Data format: Array of associative arrays with `timestamp` and `title` keys
- Option A: Sync from Cablecast API if chapter data is available
- Option B: Allow manual entry via WordPress admin
- Option C: Parse from video metadata during sync

**Meta field name:** `cablecast_show_chapters`
**Expected value:** Serialized array
```php
[
['timestamp' => '00:00:00', 'title' => 'Introduction'],
['timestamp' => '00:05:30', 'title' => 'Main Topic'],
['timestamp' => '00:15:00', 'title' => 'Q&A'],
]
```

## Notes

- Both features require corresponding changes in `includes/sync.php` if sourcing from Cablecast API
- Theme templates are ready to consume this data once meta fields are populated
Loading