<?php
/**
 * Migration Helper - Backward Compatibility
 */

if (!defined('ABSPATH')) exit;

class Trstemp_Migration {
    
    /**
     * Update option with both old and new names for backward compatibility
     */
    public static function update_option_with_prefix($old_name, $new_name, $value) {
        update_option($new_name, $value);
        update_option($old_name, $value);
    }
    
    /**
     * Get option with fallback to old name
     */
    public static function get_option_with_fallback($new_name, $old_name, $default = false) {
        $value = get_option($new_name, null);
        
        if ($value === null) {
            $value = get_option($old_name, $default);
            if ($value !== $default) {
                update_option($new_name, $value);
            }
        }
        
        return $value;
    }
}
