HEX
Server: LiteSpeed
System: Linux spg20.cloudpowerdns.com 5.14.0-611.35.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 25 03:46:09 EST 2026 x86_64
User: carrerup (3153)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/carrerup/.trash/techland/inc/merlin/includes/class-merlin-option-tree-importer.php
<?php
/**
* Class for the Redux importer.
*
* @see https://wordpress.org/plugins/redux-framework/
*
* @package Merlin WP
*/

class Merlin_Option_Tree_Importer {
    /**
    * Import Option Tree data from a text file, generated by the Option Tree plugin.
    *
    *
    * @return boolean
    */
    public static function import() {

        // Option Tree plugin is not active!
        if ( ! class_exists( 'OT_Loader' ) ) {
            return false;
        }

        global $wp_filesystem;

        require_once ( ABSPATH . '/wp-admin/includes/file.php' );
        WP_Filesystem();

        $local_file = get_parent_theme_file_path( '/includes/merlin/demodata/optiontree.txt' );
        $decoded = '';
        $decoded = base64_decode( $wp_filesystem->get_contents( $local_file ) );
        $data = maybe_unserialize( $decoded );
        if ( $wp_filesystem->exists( $local_file ) ) {
            update_option( 'option_tree', $data );
        }

        return true;
    }
}