=== 1 CDN Manager ===
Contributors: techtonicsystems
Tags: cdn, performance, cache, cloudflare, optimization
Requires at least: 5.0
Tested up to: 6.8
Stable tag: 2.3.7
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Professional WordPress CDN integration system for managing Image, Media, Static, Fonts, and Frontend URL CDNs with advanced caching.

== Description ==

**1 CDN Manager** is a comprehensive CDN integration plugin that allows you to manage multiple CDN types for optimal WordPress performance. Perfect for high-traffic websites requiring professional CDN management.

= Key Features =

* **Default CDN (NEW)**: Instant setup with preconfigured 1cdn.us subdomains - no DNS configuration needed
* **5 CDN Types Support**: Image CDN, Media CDN, Static CDN (CSS/JS), Fonts CDN, and Frontend URL
* **Advanced URL Rewriting**: Intelligent URL replacement for all asset types
* **Smart Caching**: Built-in cache system with automatic optimization
* **CORS Support**: Automatic Cross-Origin Resource Sharing configuration
* **Cloudflare Integration**: Direct cache management and purging (optional)
* **Content Migration**: Tools for migrating existing content to CDN
* **Conflict Detection**: Automatically detects conflicting CDN plugins
* **Multi-Domain Support**: Serve different asset types from different CDN domains
* **Developer Friendly**: Clean code, hooks, and filters for customization

= Default CDN - Instant Setup =

The new Default CDN feature provides immediate CDN acceleration without any DNS configuration:

* **js.1cdn.us** - JavaScript files
* **cs.1cdn.us** - CSS files
* **im.1cdn.us** - Images
* **ft.1cdn.us** - Fonts
* **mi.1cdn.us** - Media (audio/video)

Simply enable Default CDN and select which asset types to accelerate. No custom domains or complex setup required!

= Use Cases =

* High-traffic WordPress sites requiring CDN acceleration
* Multi-domain CDN configurations
* Sites using Cloudflare or custom CDN providers
* E-commerce sites with heavy image/media content
* Publishers and media websites
* SaaS platforms built on WordPress

= 5 CDN Types Explained =

1. **Image CDN**: Serves images (.jpg, .png, .gif, .webp, .svg) from uploads and plugins
2. **Media CDN**: Serves videos, audio files, and documents (.mp4, .pdf, .zip, etc.)
3. **Static CDN**: Serves CSS and JavaScript files from themes and plugins
4. **Fonts CDN**: Serves web fonts (.woff, .woff2, .ttf, .otf, .eot)
5. **Frontend URL**: General domain replacement for all frontend URLs

= Cloudflare Integration =

* Purge all cache with one click
* Selective URL purging
* Wildcard purge support
* Developer mode toggle
* Always Online configuration
* Browser cache TTL management

= Technical Features =

* Zero configuration required for basic setup
* Automatic .htaccess generation for cache directories
* Smart URL detection and replacement
* Compatible with WooCommerce, page builders, and popular plugins
* Minimal database queries for optimal performance
* No external dependencies

== Installation ==

= Automatic Installation =

1. Go to WordPress Admin → Plugins → Add New
2. Search for "1 CDN Manager"
3. Click "Install Now" and then "Activate"
4. Go to CDN Manager → Settings to configure your CDN URLs

= Manual Installation =

1. Download the plugin zip file
2. Go to WordPress Admin → Plugins → Add New → Upload Plugin
3. Select the downloaded zip file
4. Click "Install Now" and then "Activate"
5. Configure your CDN settings at CDN Manager → Settings

= Configuration =

1. Navigate to **CDN Manager → Settings**
2. Enable the CDN types you want to use
3. Enter your CDN URLs for each type
4. Save settings
5. Optionally use Content Migration to update existing URLs

== Frequently Asked Questions ==

= What CDN providers are supported? =

1 CDN Manager works with any CDN provider that supports URL-based acceleration including Cloudflare, Amazon CloudFront, KeyCDN, BunnyCDN, StackPath, and custom CDN solutions.

= Do I need a CDN provider account? =

Yes, you'll need CDN URLs from your provider. Most CDN providers offer free tiers for testing.

= Will this plugin work with page builders? =

Yes, it's fully compatible with Elementor, WPBakery, Divi, Beaver Builder, and other popular page builders.

= Can I use different CDN URLs for different asset types? =

Absolutely! That's one of the main features. You can configure separate CDN URLs for images, media, static files, fonts, and frontend URLs.

= Does it work with WooCommerce? =

Yes, fully compatible with WooCommerce product images, gallery images, and all media files.

= What happens if I disable the plugin? =

Your site will immediately stop using CDN URLs and revert to local URLs. No database changes are made unless you use the Content Migration feature.

= Can I migrate existing content to CDN? =

Yes, use the Content Migration tool to permanently update URLs in your database. Always backup before migration.

= Does it support multisite? =

Currently optimized for single-site installations. Multisite support may be added in future versions.

= Is it compatible with caching plugins? =

Yes, works seamlessly with WP Rocket, W3 Total Cache, WP Super Cache, LiteSpeed Cache, and other caching plugins.

= Can I test CDN configuration before going live? =

Yes, the plugin includes diagnostic tools to test URL replacement and identify configuration issues.

== Screenshots ==

1. Main Settings Page - Configure all 5 CDN types
2. Tools Page - Cache management and diagnostics
3. Content Migration - Update existing URLs
4. Cloudflare Integration - Direct cache control

== Changelog ==

= 2.3.7 - 2025-08-15 =
* ADDED: Automatic update checker - plugin now checks S3 for new versions
* ADDED: "Check for Updates" button in Tools page for manual update checks
* IMPROVED: WordPress will automatically notify users when new versions are available
* IMPROVED: Update notifications show in WordPress admin dashboard
* FIXED: Update system now works independently from WordPress.org marketplace

= 2.3.6 - 2025-08-15 =
* IMPROVED: Diagnostic tool now shows actual CDN URLs for images, media, and fonts (not just admin context message)
* ADDED: CSS CDN and JavaScript CDN now visible in Database Settings section
* RENAMED: "video" to "media" for consistent terminology
* UPDATED: Static CDN relabeled as "Static CDN (Legacy)" in diagnostic results
* IMPROVED: All 5 CDN types now display with expected URLs and success indicators

= 2.3.5 - 2025-08-15 =
* FIXED: CDN URL Diagnostic Tool now correctly identifies CSS and JavaScript CDN routing
* IMPROVED: Diagnostic tool no longer shows false errors for images, videos, and fonts in admin context
* UPDATED: Test logic updated for new CDN architecture (separate CSS and JS CDNs instead of Static CDN)
* IMPROVED: Clearer messaging about expected behavior in admin vs frontend context
* IMPROVED: Better visual indicators (ℹ️ for informational, ✓ for success, ❌ for actual errors)

= 2.0.6 - 2025-10-24 =
* DEBUG: Added detailed error logging for registration API responses
* IMPROVED: Better error messages showing actual API response
* IMPROVED: Logs HTTP status code and response body for troubleshooting
* Check WordPress debug.log for detailed error information

= 2.0.5 - 2025-10-24 =
* SECURITY: Registration API now re-verifies domain ownership before registration
* SECURITY: Revoke now requires verification (prevents unauthorized revocation)
* ADDED: DNS verification via Cloudflare DNS-over-HTTPS API
* ADDED: Meta tag verification by fetching domain homepage
* ADDED: File verification by checking verification file
* IMPROVED: Plugin sends token to API for server-side verification
* CLOUDFLARE WORKER: registration-api-v2.js updated to v2.2 with verification

= 2.0.4 - 2025-10-24 =
* CRITICAL FIX: Registration calling wrong API endpoint (register.1cdn.us instead of api.1cdn.us)
* CHANGED: register_domain() now calls https://api.1cdn.us with proper JSON structure
* CHANGED: is_registered() checks cdn1_registered option instead of cdn1_secure_key
* UPDATED: Button text from "Complete Registration & Get CDN Key" to "Complete Registration"
* UPDATED: Description text to remove references to CDN keys
* IMPROVED: Registration now stores is_active flag
* IMPROVED: Revoke calls Cloudflare API for soft delete

= 2.0.3 - 2025-10-24 =
* CRITICAL FIX: Plugin meta tag appearing even when Default CDN disabled
* CRITICAL FIX: Domain verification returning "Invalid API response" error
* CHANGED: Domain verification now checks locally (DNS/Meta/File) instead of external API
* ADDED: Local DNS TXT record checker
* ADDED: Local meta tag checker (fetches your site and parses HTML)
* ADDED: Local file checker (fetches verification file from site)
* REMOVED: Dependency on external verification API (register.1cdn.us)
* META TAG: Only injected when Default CDN is enabled

= 2.0.2 - 2025-10-24 =
* CRITICAL FIX: Default CDN URLs still being applied when Default CDN disabled
* FIXED: Added is_default_cdn_enabled() check at start of replace_in_html_default_cdn()
* Now correctly skips URL replacement when Default CDN is disabled

= 2.0.1 - 2025-10-24 =
* CHANGED: KV namespace from 1CDN_SECURITY_KEYS to 1CDN_REGISTRATION
* IMPROVED: Soft delete on revoke (sets is_active: false, doesn't delete row)
* IMPROVED: Registration adds new row with is_active: true
* REMOVED: MASTER_SECRET requirement (not needed anymore)
* UI: Security tab always visible (independent of Default CDN status)
* UI: Removed note about Default CDN requirement
* CLOUDFLARE WORKER v2.5.1: Updated to use 1CDN_REGISTRATION KV

= 2.0.0 - 2025-10-24 =
* MAJOR ARCHITECTURAL CHANGE: Removed 1cdnkey parameter from URLs completely
* SIMPLIFIED: Changed to domain-based registration (no keys in URLs)
* SECURITY TAB: Now accessible without enabling Default CDN
* VERIFICATION: Domain verification and registration work independently
* CLOUDFLARE WORKER v2.5: Checks domain registration only, no key validation
* VERIFICATION EXPIRY: Domains must re-verify every 7 days
* CLEANER URLS: All CDN URLs now only have versioning parameter (1cdnver)
* BREAKING CHANGE: Existing registered domains must re-register (no backward compatibility)

= 1.9.6 - 2025-10-24 =
* CRITICAL FIX: CDN key was only added when versioning was enabled
* FIXED: Made CDN key logic independent of versioning in add_versioning() method
* CHANGED: CDN key retrieval moved before version check (line 447)
* RESULT: CDN keys now added even if versioning is disabled for that asset type
* This ensures registered domains ALWAYS get unlimited access regardless of version settings

= 1.9.5 - 2025-10-24 =
* ARCHITECTURAL FIX: Integrated CDN key injection directly into add_versioning() method
* FIXED: CDN key now added using the EXACT same approach as versioning
* APPROACH: Instead of calling separate append_cdn_key() method, key is added inline where version is added
* This mirrors how 1cdnver works (which was working correctly)
* Removed all separate append_cdn_key() calls - key is now added automatically with versioning
* Guaranteed to work since it uses the proven versioning code path

= 1.9.4 - 2025-10-24 =
* CRITICAL FIX: Early return check preventing CDN key injection on cached pages
* FIXED: replace_in_html_default_cdn() was exiting early if URLs already transformed
* REMOVED: Problematic check at line 739 that detected existing 1cdn.us URLs and skipped processing
* Result: CDN keys now added even on subsequent page loads (not just first load)
* This fixes the persistent issue where keys were missing after cache/page reload

= 1.9.3 - 2025-10-24 =
* CRITICAL FIX: CDN key still missing from Default CDN URLs (ft.1cdn.us, js.1cdn.us, etc.)
* FIXED: replace_in_html_default_cdn() method missing append_cdn_key() calls
* ADDED: CDN key injection to all 6 Default CDN replacement callbacks (JS, CSS, Images, Media, Fonts, inline CSS)
* Default CDN users with registered domains will now get unlimited access
* This completes the fix started in v1.9.2 (which only fixed custom CDN URLs)

= 1.9.2 - 2025-10-24 =
* CRITICAL FIX: CDN key parameter missing from fonts, images, media, and CSS/JS URLs
* FIXED: Registered domains were still being rate-limited due to missing 1cdnkey parameter
* ADDED: append_cdn_key() calls to all HTML replacement methods
* All asset types now include both versioning (1cdnver) AND CDN key (1cdnkey)
* Fonts, images, media, CSS, and JS now work correctly with domain registration
* High priority upgrade for users with registered domains

= 1.9.1 - 2025-01-15 =
* CRITICAL FIX: Admin JavaScript was being cached by CDN
* ADDED: Exclude /admin/js/ files from CDN rewriting
* ADDED: Exclude /wp-admin/ files from CDN rewriting
* Admin scripts now load directly (not through CDN) ensuring fresh versions
* Fixes "event handlers not attached" issue caused by cached old JavaScript
* Security tab buttons will now work immediately after installation

= 1.9.0 - 2025-01-15 =
* CRITICAL FIX: cdn1_ajax JavaScript variable not defined (wp_localize_script issue)
* FIXED: Removed duplicate wp_localize_script calls that were conflicting
* FIXED: Consolidated into single localization with both ajaxurl and ajaxUrl
* FIXED: Buttons now work - AJAX requests can be made
* This fixes the "nothing happens when clicking buttons" issue

= 1.8.9 - 2025-01-15 =
* FIXED: Security tab buttons not working (form submission interference)
* ADDED: Form submit handler to prevent submission when security buttons clicked
* IMPROVED: Added stopImmediatePropagation() to all security button handlers
* IMPROVED: Enhanced console logging for button detection debugging
* IMPROVED: Better error messages in registration AJAX handler
* All security buttons now work correctly: Auto-inject, Verify, Registration

= 1.8.8 - 2025-01-15 =
* UPDATED: Cloudflare Worker code for KV namespace `1CDN_SECURITY_KEYS`
* FIXED: Worker code now uses bracket notation: env['1CDN_SECURITY_KEYS']
* IMPROVED: registration-api.js updated to v1.1.0 with modern ES6 syntax
* IMPROVED: All documentation updated for correct KV namespace name
* DOCS: CDN_KEYS-ERROR-FIX.md completely rewritten for 1CDN_SECURITY_KEYS
* Ready to deploy - worker code matches your KV namespace configuration

= 1.8.7 - 2025-01-15 =
* ADDED: Cloudflare Worker setup documentation
* ADDED: CLOUDFLARE-SETUP-REQUIRED.md with step-by-step KV binding guide
* IMPROVED: Better error handling guidance for "CDN_KEYS is not defined" error
* DOCS: Visual guide for Cloudflare Dashboard navigation
* DOCS: Common mistakes and troubleshooting section
* This is a documentation-only update - no code changes

= 1.8.6 - 2025-01-15 =
* COMPLETE REDESIGN: All 3 verification methods now always visible
* REMOVED: Dropdown selector (was causing issues)
* IMPROVED: No JavaScript switching needed - simpler and foolproof
* IMPROVED: Each method in color-coded container for easy identification
* Blue container: Meta Tag (easiest)
* Green container: DNS TXT (most secure)
* Yellow container: Text File (alternative)
* Users can see all options at once and choose which to use

= 1.8.5 - 2025-01-15 =
* COMPLETE REWRITE: Pure vanilla JavaScript implementation (no jQuery dependency)
* Uses native addEventListener for dropdown changes
* Uses document.getElementById and querySelectorAll
* Direct style.display manipulation - guaranteed to work
* Extensive console logging for debugging
* WILL WORK even if jQuery has issues

= 1.8.4 - 2025-01-15 =
* CRITICAL FIX: Changed from .show()/.hide() to .css('display', 'block/none')
* FIXED: jQuery .show()/.hide() not overriding inline styles
* IMPROVED: Direct CSS manipulation ensures display property changes
* Now properly switches between verification method sections

= 1.8.3 - 2025-01-15 =
* FIXED: Dropdown change event not triggering content switch
* FIXED: Used event delegation for dropdown handler ($(document).on)
* FIXED: Removed conflicting "active" class from first content section
* IMPROVED: Added extensive console logging for debugging
* IMPROVED: All content sections now properly show/hide on dropdown change
* JavaScript updated with better event handling

= 1.8.2 - 2025-01-15 =
* IMPROVED: Replaced verification method tabs with dropdown select
* IMPROVED: Better UX - Single dropdown instead of 3 tabs for verification methods
* IMPROVED: Cleaner interface in Security tab
* IMPROVED: Options show descriptive text (e.g., "Meta Tag - Easiest for WordPress")
* Updated JavaScript to v1.8.2 with dropdown change handler
* Verification methods: Meta Tag, DNS TXT Record, Text File

= 1.8.1 - 2025-01-15 =
* NEW: Dedicated Security tab added to main navigation
* IMPROVED: Security features now in standalone tab (no longer embedded in CDN Settings)
* IMPROVED: Better organization - 4 main tabs: CDN Settings, Content Rewriting, Security, Advanced
* IMPROVED: Conditional display - Security tab shows notice when Default CDN is disabled
* IMPROVED: Cleaner UI with focused tab sections
* Updated JavaScript version to 1.8.0 with Security tab support

= 1.8.0 - 2025-01-20 =
* COMPLETE REWRITE: Inline JavaScript tab switching (no external JS dependency)
* Each tab button has complete vanilla JavaScript in onclick
* Prevents form submission with event.preventDefault()
* Manually toggles classes without jQuery
* Works even if external JavaScript fails to load
* This is the nuclear option - pure HTML/JS solution

= 1.7.9 - 2025-01-19 =
* CRITICAL FIX: Added form submit handler to prevent accidental submissions
* Form only submits when Save Settings button is clicked
* All other clicks (including tabs) are blocked from submitting
* Added console logging for form submission attempts
* This should finally fix the tabs removing content issue

= 1.7.8 - 2025-01-19 =
* CRITICAL FIX: Added inline onclick="return false;" to all tab buttons
* This prevents form submission even if JavaScript hasn't loaded yet
* Works as a fallback if event handlers fail to attach
* Applies to both main tabs and verification tabs
* Should fix tabs removing content issue permanently

= 1.7.7 - 2025-01-19 =
* DEBUGGING: Added console logs to verify JavaScript loading
* Added timestamp to JS file enqueue to force cache refresh
* Added script load confirmation and jQuery version logging
* Console now shows: "CDN Manager Admin JS v1.7.7 loaded"
* Added "Document ready fired" log for debugging
* Note: CDN_KEYS error is Cloudflare Worker issue (see deployment docs)

= 1.7.6 - 2025-01-19 =
* CRITICAL FIX: Fixed tab selector conflict between main tabs and verification tabs
* Main tabs now use :not(.cdn1-verify-tab) selector to exclude verification tabs
* Verification tabs now use stopImmediatePropagation to prevent event bubbling
* Added console logging to distinguish between main and verification tab clicks
* Both tab types now work independently without interfering with each other

= 1.7.5 - 2025-01-19 =
* CRITICAL FIX: Added preventDefault to main CDN Settings tabs
* Main tabs were causing form submission and removing page content
* Enhanced AJAX error handling with HTTP status code detection
* Added detailed error messages (403, 400, 500, network errors)
* Console now shows full error details for debugging
* Fixed tabs removing all center content issue

= 1.7.4 - 2025-01-19 =
* CRITICAL FIX: Added proper wp_localize_script for cdn1_ajax with correct nonce
* CRITICAL FIX: Changed all AJAX calls to use cdn1_ajax.ajaxurl instead of ajaxurl
* Added comprehensive console logging for debugging
* Added error response logging in AJAX error handlers
* Fixed AJAX calls hanging on "Enabling..." or "Checking..."
* Improved error messages with fallbacks

= 1.7.3 - 2025-01-19 =
* CRITICAL FIX: Changed API endpoint from api.1cdn.us to register.1cdn.us
* CRITICAL FIX: Used event delegation ($(document).on) for dynamically loaded content
* Added console logging for debugging verification buttons
* Fixed tabs and buttons not working when Security section is conditionally loaded
* Improved event handling for AJAX-loaded content

= 1.7.2 - 2025-01-19 =
* BUG FIX: Fixed verification tabs causing blank page on click
* BUG FIX: Fixed verify buttons not being clickable
* Added preventDefault() to all tab and button click handlers
* Prevents form submission when clicking verification tabs
* Improved JavaScript event handling for better reliability

= 1.7.1 - 2025-01-19 =
* NEW: Plugin identification meta tag automatically added to all pages
* Tracks: Plugin version, Default CDN status, Security registration status
* Includes: Unique installation ID (first 8 chars) for analytics
* Added: Generator meta tag for better plugin visibility
* Meta format: v1.7.1|cdn:on|sec:yes|id:abc12345
* Always enabled for plugin identification and support purposes

= 1.7.0 - 2025-01-19 =
* MAJOR FEATURE: Secure CDN Key System to prevent unauthorized CDN usage
* Domain verification via DNS TXT record, Meta Tag, or Text File
* Automatic key generation using HMAC-SHA256 cryptography
* Unique per-domain CDN keys for secure access control
* Complete Cloudflare Workers integration (Registration API + CDN Validator)
* WordPress admin UI for verification and registration workflow
* Auto-inject meta tag option for easy verification
* Key management: view, regenerate, revoke registration
* Comprehensive setup documentation for Cloudflare Workers deployment
* CDN URLs now include ?1cdnkey parameter for validation

= 1.6.0 - 2025-01-19 =
* UI IMPROVEMENT: Moved tip notice to bottom of URL Configuration section
* Better visual flow - tip now appears below Save Configuration button
* Cleaner form layout with important information at decision point
* Improved UX - tip is visible after reviewing all fields

= 1.5.9 - 2025-01-19 =
* UI FIX: Adjusted column width ratio in Site URL Configuration page
* Reduced left column (label) width from default to 180px
* Right column (input/description) now has more space
* Better visual balance and improved readability
* Fixes column compression issue in URL Configuration form

= 1.5.8 - 2025-01-19 =
* BEST FIX: Now uses SERVER_NAME to determine correct URL
* No more string replacement or regex - uses actual server name
* Bulletproof: Takes https://[SERVER_NAME] as the correct URL
* Example: SERVER_NAME = wpdemo.utility-server.com → https://wpdemo.utility-server.com
* Always accurate regardless of how WordPress was accessed

= 1.5.7 - 2025-01-19 =
* CRITICAL FIX: Corrected regex pattern in Fix WordPress URLs tool
* Changed from regex to simple str_replace to avoid over-aggressive matching
* Now correctly removes only "-admin" part while preserving rest of domain
* Example: wpdemo-admin.utility-server.com -> wpdemo.utility-server.com (correct)
* SQL fix commands provided for immediate database correction

= 1.5.6 - 2025-01-19 =
* NEW TOOL: Fix WordPress URLs button in diagnostics
* Automatically detects if WordPress home/siteurl are set to admin domain
* One-click fix to correct WordPress core URLs
* Removes admin subdomain from home and siteurl options
* Prevents incorrect URL detection shown in your case

= 1.5.5 - 2025-01-19 =
* ENHANCED: Auto-delete CDN URLs when their respective toggle is disabled
* Applies to all CDN types: Origin, Admin, Image, Media, CSS, JS, Static, Fonts, Frontend
* Automatic cleanup happens on every settings save
* Ensures no orphaned URLs remain when CDN is disabled
* Maintains clean database state

= 1.5.4 - 2025-01-19 =
* ENHANCED: Clear all custom CDN URLs when Default CDN is enabled
* Deletes saved URLs for Origin, Admin, Image, Media, CSS, JS, Static, Fonts, Frontend
* Also clears Site URL Management URLs (custom_site_url, custom_admin_url)
* Prevents confusion from leftover disabled URLs in database
* Clean slate when switching to Default CDN

= 1.5.3 - 2025-01-19 =
* FIXED: Site URL Management toggle now disabled when Default CDN is ON
* Added visual warning notice when Default CDN prevents Site URL Management
* Toggle grayed out and cannot be turned on when Default CDN is active
* Red description text clearly explains why feature is disabled
* Prevents conflicting configurations at UI level

= 1.5.2 - 2025-01-19 =
* FEATURE: Site URL Management auto-disables when Default CDN is enabled
* FEATURE: Auto-detect URLs only shows enabled CDN URLs
* Shows "(Enabled)" or "(Disabled)" status for Frontend URL and Admin URL
* Prevents conflicts between Default CDN and Site URL Management
* Clearer indication of which CDN types are active

= 1.5.1 - 2025-01-19 =
* CRITICAL: Auto-regenerate .htaccess when CDN settings are saved
* CRITICAL: Auto-purge cache when CDN settings are saved
* Prevents CORS errors by ensuring .htaccess is always up-to-date
* No manual intervention needed - .htaccess and cache handled automatically
* Success message confirms auto-regeneration occurred

= 1.5.0 - 2025-01-19 =
* ADDED: 1CDN branding header to Site URL Configuration page
* REMOVED: DEBUG rows from diagnostics table (5 debug entries removed)
* REMOVED: WP_HOME and WP_SITEURL warnings from issues section
* UI cleanup for cleaner, more professional appearance
* Diagnostics now show only relevant production information

= 1.4.9 - 2025-01-19 =
* RADICAL FIX: Removed redirect completely - NO MORE POST-REDIRECT-GET
* Form submission now saves and displays page directly
* Success message shown inline after save without redirect
* Eliminates all redirect-related issues with URL filters
* Page always renders correctly after save

= 1.4.8 - 2025-01-19 =
* FIXED: Root cause identified - URL filters interfered with redirect
* Generate redirect URL BEFORE Site URL Management filters activate
* Temporarily remove URL filters during redirect to prevent interference
* Redirect now uses unfiltered admin URL
* Blank page issue after save finally resolved

= 1.4.7 - 2025-01-19 =
* FIXED: Completely rewrote view file variable initialization
* FIXED: Removed all early CDN1_Site_Config calls from top of file
* Variables now initialized using direct WordPress functions (get_option, home_url, etc.)
* Lazy loading of diagnostics/issues right before use in HTML
* Added proper class/method existence checks before calling CDN1_Site_Config methods
* View file now renders even if CDN1_Site_Config methods fail

= 1.4.6 - 2025-01-19 =
* FIXED: Moved success/error messages to admin_notices hook (WordPress standard)
* FIXED: Removed inline message rendering from view that was causing blank page
* Messages now display properly using WordPress admin notices system
* Simplified view file - removed transient checking logic

= 1.4.5 - 2025-01-19 =
* FIXED: Changed wp_redirect() to wp_safe_redirect() for better compatibility
* FIXED: Added settings-updated parameter to redirect URL
* FIXED: Enhanced success message detection with WordPress standard parameter
* Improved redirect reliability and page loading after save

= 1.4.4 - 2025-01-19 =
* FIXED: Blank page issue after saving Site URL Configuration
* Added error handling (try-catch) for diagnostic functions
* Prevents page rendering failure when diagnostics fail after save/redirect
* Page now loads correctly with success/error messages after save
* Improved stability when toggling Site URL Management feature

= 1.4.3 - 2025-01-19 =
* FIXED: Added HTML5 required attributes to Site URL and Admin URL fields
* FIXED: Dynamic required validation - fields required only when toggle is enabled
* FIXED: Improved JavaScript to handle required attribute on toggle change
* ENHANCEMENT: Added red asterisk (*) to required fields for better UX
* ENHANCEMENT: Updated field descriptions for clarity
* Server-side validation already in place from v1.4.2

= 1.4.2 - 2025-01-19 =
* ENHANCEMENT: Added form validation to Site URL Configuration
* Site URL and Admin URL are now required when feature is enabled
* Fixed blank page issue after saving - proper success/error messages now display
* Improved user feedback with clear validation error messages
* Better redirect handling using WordPress transients
* Enhanced user experience with dismissible success/error notices

= 1.4.1 - 2025-01-18 =
* NEW FEATURE: Site URL Configuration Management
* Added dedicated "Site Configuration" admin page
* Prevents plugins from detecting wrong URLs when admin is on separate domain
* Automatic URL override for WP_HOME and WP_SITEURL
* Comprehensive diagnostics showing detected vs configured URLs
* List of potentially affected plugins (Google Site Kit, Jetpack, etc.)
* Auto-detect and auto-fill functionality for easy setup
* Solves plugin reconnection issues when using separate admin URL
* No manual wp-config.php editing required

= 1.3.2 - 2025-01-18 =
* CRITICAL FIX: Comprehensive solution for URL encoding issue with %20 in CDN URLs
* Fixed root cause: trailing/leading spaces in CDN base URLs causing encoding issues
* Added triple-layer protection: save sanitization, retrieval trimming, and construction trimming
* Applied fix to ALL CDN types: CSS, JavaScript, Images, Media, Static, and Fonts
* Users must clear all caches after updating (plugin cache, WordPress cache, browser cache)
* Optional: Re-save CDN settings to clean legacy values with spaces

= 1.3.1 - 2025-01-18 =
* Fixed URL encoding issue causing %20 in CSS and JavaScript CDN URLs
* Improved URL scheme handling in CSS and JS replacement logic
* Cache clear recommended after update for existing Default CDN users

= 1.3.0 - 2025-01-18 =
* NEW FEATURE: Default CDN with preconfigured 1cdn.us subdomains
* Added instant CDN setup - no DNS configuration needed
* Supported subdomains: js.1cdn.us (JavaScript), cs.1cdn.us (CSS), im.1cdn.us (Images), ft.1cdn.us (Fonts), mi.1cdn.us (Media)
* URL format: https://[subdomain].1cdn.us/https://yourdomain.com/path
* Default CDN automatically disables custom CDN settings when enabled
* Individual enable/disable controls for each Default CDN asset type
* All versioning features work with Default CDN
* Admin notice system for Default CDN status
* Updated UI with priority placement of Default CDN section
* JavaScript handling for mutual exclusivity between Default CDN and custom CDNs

= 1.2.5 - 2025-01-17 =
* Fixed text domain to use '1cdn-manager' (without hyphen) for WordPress compliance
* Removed direct chmod() call, using wp_mkdir_p() which handles permissions correctly
* Updated all documentation with version 1.2.5

= 1.2.4 - 2025-01-17 =
* CRITICAL FIX: Fonts and Media versioning now working correctly in HTML content
* CRITICAL FIX: CDN Re-routing - Plugin now re-routes URLs already using wrong CDN domains
* CRITICAL FIX: Videos on Image CDN are now automatically re-routed to Media CDN
* Enhanced source hosts to include all configured CDN domains for proper re-routing
* Fixed HTML replacement methods to include versioning for all asset types
* Updated replace_images_in_html() to apply versioning
* Updated replace_media_in_html() to apply versioning
* Updated replace_static_in_html() to apply versioning
* Updated replace_fonts_in_html() to apply versioning
* Frontend URL now detects file type and applies proper versioning
* Media and Fonts get versioning even when routed through Frontend URL
* All 5 asset types now get consistent versioning when enabled
* Created complete documentation (8 pages): Getting Started, CDN Settings, Versioning, Tools, Migration, Cloudflare, Troubleshooting, FAQ
* Added comprehensive SEO optimization with meta tags, keywords, Open Graph, and Schema.org
* Created sitemap.xml and robots.txt for search engine optimization
* Added step-by-step how-to guides for versioning scenarios
* Added documentation link to main website
* Complete knowledge base for all plugin features

= 1.2.3 - 2025-10-14 =
* Changed version parameter from 'ver' to '1cdnver' for unique identification
* Created comprehensive documentation with multiple HTML pages
* Added docs/index.html - Getting Started guide
* Added docs/versioning.html - Complete versioning documentation
* Added docs/css/docs.css - Separate stylesheet for documentation
* Added docs/js/docs.js - Interactive features for documentation
* Documentation covers all menus, tabs, and options in detail
* Professional documentation design with sidebar navigation

= 1.2.2 - 2025-10-14 =
* FIXED: Aggressive version parameter replacement for CSS and Fonts
* Now removes ALL existing version parameters (v, ver, version, _v, _, rev, r) before adding custom version
* CSS files now properly versioned (replaces WordPress default versions)
* Fonts now properly versioned
* Media files now properly versioned
* Simplified labels: "Image Versioning" instead of "Image CDN Versioning"

= 1.2.1 - 2025-10-14 =
* ENHANCED: Separate versioning for each CDN type for full control
* Image CDN versioning (independent control)
* Media CDN versioning (videos/audio)
* CSS versioning (separate from JS)
* JavaScript versioning (separate from CSS)
* Fonts CDN versioning (fonts and documents)
* Each asset type can have different version strings
* Perfect for granular cache control

= 1.2.0 - 2025-10-14 =
* NEW FEATURE: CDN Versioning / Cache Busting
* Add version parameter to all CDN URLs (e.g., ?ver=1.0)
* Smart handling of existing query strings
* Auto-updates existing version parameters (v, ver, version, _v)
* Configure version string in Advanced settings
* Perfect for forcing browsers to fetch updated assets
* Works with all CDN types (Image, Media, Static, Fonts, Frontend URL)

= 1.1.4 - 2025-10-14 =
* CRITICAL FIX: CSS and JavaScript were not loading on plugin pages!
* Fixed hook check in enqueue_admin_assets (uscdn → cdn1)
* Tabs now properly styled with borders and backgrounds
* Active tab now shows blue background with white text
* All admin styling now working correctly

= 1.1.3 - 2025-10-14 =
* Fixed active tab styling - now VERY visible with blue background and white text
* Active tab now has clear visual distinction from inactive tabs
* Removed confusing gray backgrounds that made all tabs look the same
* Inactive tabs are transparent with light border
* Active tab has blue background (#2271b1) with white text and shadow
* Much better visual hierarchy and user clarity

= 1.1.2 - 2025-10-14 =
* Restored original tab functionality (was broken during uscdn → cdn1 rename)
* Fixed tab buttons - now work with JavaScript as intended
* Tabs stay within settings page (removed from branding.php)
* CDN Settings, Content Rewriting, and Advanced tabs now functional again
* Maintained modern styling with active tab indicators

= 1.1.1 - 2025-10-14 =
* Added active tab indicator with visual highlight
* Improved tab navigation with better styling and hover effects
* Added description section below branding with better spacing
* Enhanced tab design with background colors and rounded corners
* Fixed whitespace issues between branding and navigation
* Better visual hierarchy for active vs inactive tabs

= 1.1.0 - 2025-10-14 =
* Added automatic redirect from old URLs (uscdn-*) to new URLs (cdn1-*)
* Fixed "Sorry, you are not allowed to access this page" error for bookmarked links
* Preserves query parameters during redirect
* Maintains backward compatibility with old menu slugs

= 1.0.9 - 2025-10-14 =
* Fixed Cloudflare test connection (nonce mismatch cdn1 vs uscdn)
* Fixed all Cloudflare AJAX handlers (7 nonce references)
* Fixed cache directory path (uscdn-css → cdn1-css)
* Fixed admin menu slugs (uscdn-settings → cdn1-settings, etc.)
* Added automatic cache directory creation on admin init
* Added cache directory creation on plugin activation

= 1.0.8 - 2025-10-14 =
* Fixed PHP syntax errors in Tools page (missing closing parentheses in wp_create_nonce)
* Resolved critical error on Tools page

= 1.0.7 - 2025-10-14 =
* Fixed Cloudflare authentication issues after rename (uscdn → cdn1 prefixes)
* Fixed admin UI inconsistencies with CSS classes and IDs
* Fixed nonce field names for security
* Updated all JavaScript event handlers
* Fixed Tools page critical error

= 1.0.6 - 2025-10-14 =
* Major rename: Plugin directory 'utility-server-cdn' to '1cdn-manager'
* Renamed main file: 'utility-server-cdn.php' to '1cdn-manager.php'
* Updated all constants: USCDN_ to CDN1_, uscdn_ to cdn1_
* Updated CSS class names from uscdn- to cdn1-
* Complete codebase consistency for WordPress.org

= 1.0.5 - 2025-10-14 =
* Fixed text domain mismatch (changed from '1cdn-manager' to '1-cdn-manager')
* Renamed language file to match new text domain
* WordPress Marketplace compliance fix

= 1.0.4 - 2025-10-14 =
* Updated branding logo to optimized high-resolution PNG version
* Improved web performance with logo optimization
* Added legal links to landing page footer (Terms, Privacy, License, Disclaimer, NDA)
* Version synchronization across all plugin files

= 1.0.0 - 2025 =
* Initial WordPress.org release
* 5 CDN types: Image, Media, Static, Fonts, Frontend URL
* Smart URL rewriting with automatic detection
* CORS support for cross-origin requests
* Cloudflare integration (optional)
* Content migration tools
* Conflict detection with other CDN plugins
* Advanced caching system
* Diagnostic tools for troubleshooting
* .htaccess generation for cache directories
* Full PHP 7.4+ and WordPress 5.0+ compatibility

== Upgrade Notice ==

= 1.0.0 =
Initial WordPress.org release with comprehensive CDN management features.

== Additional Info ==

**Plugin Website:** [https://wp-cdn-manager.1cdn.us/](https://wp-cdn-manager.1cdn.us/)

**Author:** Techtonic Systems Media and Research LLC

**Support:** For support and feature requests, please use the WordPress.org support forums.

= Privacy =

This plugin does not collect or transmit any user data. All CDN configurations are stored locally in your WordPress database.

= Credits =

Developed and maintained by Techtonic Systems Media and Research LLC.
