# Changelog

All notable changes to the Byte Sermons plugin are documented in this file.

## [1.2.1] - 2026-04-16

### Fixed
- **Critical: Fixed sermon posts not displaying in wp-admin** - Sermon posts were invisible due to post type mismatch between database and plugin code
  - Updated database: Changed all posts from `bytesm_sermon` to `bytese_sermon` (77 posts)
  - Database integrity verified: 55 published, 20 auto-draft, 1 trashed
  - All post-taxonomy relationships preserved
  
- **Taxonomy naming consistency** - Taxonomies had inconsistent naming between database and code
  - Updated all taxonomies to use consistent `bytese_*` prefixes:
    - `bytesm_series` → `bytese_series`
    - `bytesm_sermon_speaker` → `bytese_sermon_speaker`
    - `bytesm_sermon_topic` → `bytese_sermon_topic`
    - `bytesm_bible_book` → `bytese_bible_book`
  - All 1,189 scripture/bible book terms preserved

- **Scripture meta box not loading** - Bible books admin script returned 404 error
  - Fixed `plugins_url()` path in `register-taxonomies.php`
  - Changed from passing directory to passing proper plugin file path
  - Scripture selection interface now fully functional

- **Template file alignment** - Template files had outdated names
  - Renamed `taxonomy-sermon_speaker.php` → `taxonomy-bytese_sermon_speaker.php`
  - Renamed `taxonomy-sermon_topic.php` → `taxonomy-bytese_sermon_topic.php`
  - Updated template-loader.php to reference correct file names

- **WordPress security warning (PHPCS)** - Unsanitized input detected
  - Fixed sanitization of `$_POST['byte_sermons_slugs']` in permalink-settings.php
  - Used `array_map()` with `sanitize_text_field()` for proper input validation

### Changed
- Updated all 30 PHP files to use correct taxonomy names throughout codebase
- Improved asset enqueue function to use proper WordPress `plugins_url()` conventions

### Database Changes
- Direct database migration applied to ensure post type and taxonomy consistency
- No data loss - all 77 posts and 1,189 taxonomy terms preserved
- All post-taxonomy relationships validated and confirmed intact

### Testing Verified
- ✓ 77 sermon posts display in wp-admin
- ✓ 55 published sermons visible in archive
- ✓ All taxonomies properly linked to posts
- ✓ Scripture meta box functional with search/filter
- ✓ All term relationships intact
- ✓ No orphaned metadata

## [1.2.0] - 2026-03-22

### Added
- Initial release of Byte Sermons v1.2.0

---

## Notes for Users

After updating to v1.2.1, please:

1. **Clear browser cache** - Remove any cached assets
2. **Flush rewrite rules** - Go to Settings → Permalinks → Save Changes
   - Or run: `wp rewrite flush`
3. **Verify** - Check wp-admin to confirm sermons are now visible
4. **Test scripture selection** - Try selecting scriptures on a sermon post

All sermon data has been preserved and migrated correctly. This update fixes critical display issues that prevented sermons from showing in wp-admin.

---

**Plugin:** Byte Sermons
**Author:** TheByteBar
**License:** GPL v2 or later
