403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.46
Web Server : Apache
System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : infrafs ( 43850)
PHP Version : 8.2.29
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/infrafs/bike/wp-content/plugins/colibri-page-builder-pro/src/OCDI/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/infrafs/bike/wp-content/plugins/colibri-page-builder-pro/src/OCDI/ReduxImporter.php
<?php
/**
 * Class for the Redux importer used in the One Click Demo Import plugin.
 *
 * @see https://wordpress.org/plugins/redux-framework/
 * @package ocdi
 */

namespace ColibriWP\PageBuilder\OCDI;

use ReduxFrameworkInstances;

class ReduxImporter {
    /**
     * Import Redux data from a JSON file, generated by the Redux plugin.
     *
     * @param array $import_data Array of arrays. Child array contains 'option_name' and 'file_path'.
     */
    public static function import( $import_data ) {
        $ocdi          = OneClickDemoImport::get_instance();
        $log_file_path = $ocdi->get_log_file_path();

        // Redux plugin is not active!
        if ( ! class_exists( 'ReduxFramework' ) ) {
            $error_message = esc_html__( 'The Redux plugin is not activated, so the Redux import was skipped!', 'colibri-page-builder');

            // Add any error messages to the frontend_error_messages variable in OCDI main class.
            $ocdi->append_to_frontend_error_messages( $error_message );

            // Write error to log file.
            Helpers::append_to_file(
                $error_message,
                $log_file_path,
                esc_html__( 'Importing Redux settings', 'colibri-page-builder')
            );

            return;
        }

        foreach ( $import_data as $redux_item ) {
            $redux_options_raw_data = Helpers::data_from_file( $redux_item['file_path'] );

            $redux_options_data = json_decode( $redux_options_raw_data, true );

            $redux_framework = ReduxFrameworkInstances::get_instance( $redux_item['option_name'] );

            if ( isset( $redux_framework->args['opt_name'] ) ) {
                // Import Redux settings.
                $redux_framework->set_options( $redux_options_data );

                // Add this message to log file.
                $log_added = Helpers::append_to_file(
                    sprintf( esc_html__( 'Redux settings import for: %s finished successfully!', 'colibri-page-builder'), $redux_item['option_name'] ),
                    $log_file_path,
                    esc_html__( 'Importing Redux settings', 'colibri-page-builder')
                );
            } else {
                $error_message = sprintf( esc_html__( 'The Redux option name: %s, was not found in this WP site, so it was not imported!', 'colibri-page-builder'), $redux_item['option_name'] );

                // Add any error messages to the frontend_error_messages variable in OCDI main class.
                $ocdi->append_to_frontend_error_messages( $error_message );

                // Write error to log file.
                Helpers::append_to_file(
                    $error_message,
                    $log_file_path,
                    esc_html__( 'Importing Redux settings', 'colibri-page-builder')
                );
            }
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit